Search index has indexed one text field multiple times
Hi,
The index text in database looks like this:
| title |
| category |
| text field and again same text field |
The text field in question is a matrix textarea field with lots of text.
That text field is also set as search excerpt in collection.
It has to be marked as search excerpt because we use highlighting option on the search excerpt.
We also have to display whole search excerpt and showing just first few words is not an option.
I tried lowering the weight of that field and rebuilding index but cannot get it to index the text field only once. Its indexed either twice or even more times.
I also took the first itteration of the indexed field in "index_text" in database and compared it to the second itteration and they are identical.
Using
EE 2.7.3
Low Search 3.0.3
Replies
Low 18 Feb 2014 12:17
It's probably the way the Matrix field stores its searchable data. Look up the field in exp_channel_data and see what the contents is there. Low Search uses that data to set up the search index, and that data is produced by the field, not by Low Search. However, the field is used as is for the search excerpt.
hrvoje66 20 Feb 2014 10:18
Is it possible to setup Low Search so it uses exp_matrix_data table for search excerpt, if matrix field is selected to be excerpt?
We also need to keep the highlighting option.
Low 20 Feb 2014 10:31
No, Low Search can't do that out of the box. It will use the data that's in exp_channel_data. If you'd want to use Matrix data for your excerpt, then which row and column will you use?
Matrix will add the content of all searchable rows and columns together in 1 field, which is searched by the native Search module, as well as Low Search.
You could make something custom, using the low_search_excerpt extension hook.
Or you could just output the field itself and use another plugin to try and highlight the search terms.