0
votes

I am using solr 4.6 and I have a field name content name defined in solr with indexed & stored as true.

<field name="content_name" type="string" indexed="true" stored="true"/> 

Also i have defined this field in copy field

 <copyField source="content_name" dest="text"/>

I uploaded a content named abc.txt & when i try to search in solr with keyword abc, it does not return any results. I need to put either abc* or abc.xml to get this document.

Any way to fix this issue?

Regards.

2
It will be easier for people to help you if you include a sample document and actual query.John Petrone

2 Answers

0
votes

This depends on which field you're querying, as long as you're querying content_name, it requires an exact match (or with a wildcard, a prefix match). These both matches as you've discovered when you're searching for abc* or abc.xml.

Depending on the definition of the field text, you will have more luck querying that one. If it's defined as the default type of text_general, it will be tokenized and filtered, and depending on the tokenizer, text:abc as a query should work.

0
votes

Thanks,

I used WordDelimiterFilterFactory to get this working.

<filter class="org.apache.solr.analysis.WordDelimiterFilterFactory"
                generateWordParts="1"
                generateNumberParts="1"
                catenateWords="1"
                catenateNumbers="1"
                catenateAll="1"
                splitOnCaseChange="1"
                splitOnNumerics="1"
                preserveOriginal="1"
                stemEnglishPossessive="1"/>