I did one work around to get all documents that contains "Good" or "Microwave" or "Good Microwave",if i will pass "Good Microwave" as q parameter please guide me wheather i am going in right direction or not.
I defined two field type(text_general and shingleString) in my schema like below
<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
<fieldType name="shingleString" class="solr.TextField" positionIncrementGap="100" omitNorms="true">
<analyzer type="index">
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.PositionFilterFactory" />
</analyzer>
<analyzer type="query">
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.ShingleFilterFactory" outputUnigrams="true" outputUnigramIfNoNgram="true" maxShingleSize="99"/>
<filter class="solr.PositionFilterFactory" />
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
then while indexing i am adding all these field to two different copy fields like below.
<field name="SearchableField" type="shingleString" indexed="true" stored="false" multiValued="true"/>
<copyField source="ProductName" dest="SearchableField"/>
<copyField source="ProductDesription" dest="SearchableField"/>
<copyField source="Product Feedback" dest="SearchableField"/>
<field name="SearchableField1" type="text_general" indexed="true" stored="false" multiValued="true"/>
<copyField source="ProductName" dest="SearchableField1"/>
<copyField source="ProductDesription" dest="SearchableField1"/>
<copyField source="Product Feedback" dest="SearchableField1"/>
And now if i am querying on both the fields SearchableField and SearchableField1 i am getting all the documents which contains "Good" or "Microwave" or "Good Microwave". Below is the query i am using to get all the documents. q=SearchableField%3AGood+Microwave%0ASearchableField1%3AGood+Microwave
But the documents containing the whole phrase "Good Microwave",are getting a very low score. Can anybody guide me to get a higher score on those documents which contains the whole phrase if at all my approach is correct ?
Or can anybody guide me to achieve this ?