I am implementing SOLR search. When I type "abc def" I want to get all paragraphs that contains "abc def". For example if I have those paragraphs.
{
"paragraphs": ["abc def. bdbdbdbdbd, aa", "abd efe"]
},
{
"paragraphs": ["xyzabc def xyz", "fgh xx", "abcdef", "wwwabc defxxx"]
}
I want to get data from the first one. Exact match this prase so not a part of another phrase. If I search for "god dog" phrase"god doggo" should not be included in results.
The problem is when I try to use query paragraphs : "abc def" I am getting empty results.
This is part of my schema.xml:
<field name="paragraphs" type="text" indexed="true" stored="true" required="true" multiValued="true"/>
<types>
<fieldType name="text" class="solr.TextField" sortMissingLast="true" omitNorms="true">
<analyzer type="index">
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.ASCIIFoldingFilterFactory" preserveOriginal="true"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.ASCIIFoldingFilterFactory" preserveOriginal="true">
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
</types>
I tried to use StandardTokenizerFactory instead of KeywordTokenizerFactory but result was the same. I can get data using (*abc*) but this returns also elements like xabcz and I am not interested in this.