Reputation: 11
I've the following usecase: I want to use a field for autosuggest and for fulltext-search with "q"-parameter Now the problem is: When I want to do full-textsearch and choose "_textS" or "_textM" as type, then fulltextsearch works perfectly word-based. But because of the tokenization which takes place for "*_textM" in solr, I get only 1 lowercase-piece of the whole word when doing autosuggest with "Eid/Suggest". For example if I have indexed "This is a value" as "_textS" I only get "this" for autosuggest. What I need as autosuggest-value is "This is a value".
What's the best way to tackle this?
Upvotes: 1
Views: 74
Reputation: 11
Ok. Why would you use "copyField" instead of "DocValues" for this usecase?
Upvotes: 0
Reputation: 2222
If you want to use same field for autosuggest as well as search. Then you can create a copy field of that field with different fieldType. For example content is the field which is you want to use for autosuggest-search.
Then you can use content as full text-search and create an another field content_suggest for suggestions which is copy field of content with different fieldType.
<field name="content" type="_textS" indexed="true" stored="true"/>
<field name="content_suggest" type="string" indexed="true" stored="true"/>
<copyField source="content" dest="content_suggest"/>
Upvotes: 1