I am using solr, set up at localhost:8983 I am basically using the out of the box example. I have entered one document with a name "Car", and another with a name "Cars".
If I visit either:
http://localhost:8983/solr/select?q=Car
or
http://localhost:8983/solr/select?q=Cars
I would expect to get both documents. At the moment, I don't.
In the fields tag of "schema.xml", the entry for "name" is:
"text_general" has the following "analyzers" (without the stemmers):
<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.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
I tried to add a stemmer to each analyzer. I tried:
<filter class="solr.PorterStemFilterFactory"/>
<filter class="solr.KStemFilterFactory"/>
<filter class="solr.EnglishMinimalStemFilterFactory"/>
Doing so makes it such that searching for "Cars" will find "Car", but I can never find "Cars".
Should it be possible to find "Cars"?
Any help would be greatly appreciated. Thank you.
If you do not specify a field in a query, Solr searches only the default field. Alternatively, you can specify a different field or a combination of fields in a query. To specify a field, type the field name followed by a colon ":" and then the term you are searching for within the field.
Trying a basic query The main query for a solr search is specified via the q parameter. Standard Solr query syntax is the default (registered as the “lucene” query parser). If this is new to you, please check out the Solr Tutorial. Adding debug=query to your request will allow you to see how Solr is parsing your query.
You can search for "solr" by loading the Admin UI Query tab, enter "solr" in the q param (replacing *:* , which matches all documents), and "Execute Query". See the Searching section below for more information. To index your own data, re-run the directory indexing command pointed to your own directory of documents.
It is possible, just add porter filter at the end (after LowerCaseFilterFactory):
<filter class="solr.SnowballPorterFilterFactory" language="English" />
Read more:
If there is no special need, I would not divide analyser to index and query time. Your query time analyser looks perfectly good to use it in both cases.
I found that changing from text_general to text_en in the shema.xml fields took care of this plurality problem
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With