0

I am having solr 6.6 installation. I am trying to look up documents having search term with a number e.g. q=testterm 2 The field on which I am trying to run search has following definition:

<field name="text" type="text_general" indexed="true" stored="false" multiValued="true"/>

Definition for data type text_general is:

<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
      <analyzer type="index">
        <charFilter class="solr.PatternReplaceCharFilterFactory" pattern="([^A-Za-z0-9 ])" replacement=""/>
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" preserveOriginal="1"/>
        <filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="50"/>
        <filter class="solr.ReverseStringFilterFactory"/>
        <filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="50"/>
        <filter class="solr.ReverseStringFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <charFilter class="solr.PatternReplaceCharFilterFactory" pattern="([^A-Za-z0-9 ])" replacement=""/>
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" preserveOriginal="1"/>
      </analyzer>
    </fieldType>

value to field text defined earlier is populated using copyfield. The problem happens when I use search terms having number (as mentioned above) no docs are returned. Is there anyway to configure solr so that search term having number returns docs (Note: fields such as title already have value Testterm 2 and this is copied to text using copyfield)

acorntech
  • 53
  • 8

1 Answers1

0

You have many Filters on your indexing component. So I would rather advise you to have a look into the Solr Field Analyser which is a part of the Solr admin and see how your document has been transformed before indexing. That would give you an idea of how to set your search scope.

Jeeppp
  • 1,553
  • 3
  • 17
  • 39
  • I removed patterncharreplace filter from analysis and query. In the analysis admin page of solr , the term "Testterm 2" is getting indexed and the field value shows a match. The debug info for query is "rawquerystring":"testterm 2", "querystring":"testterm 2", "parsedquery":"(+(+DisjunctionMaxQuery((text:testterm)) +DisjunctionMaxQuery((text:2))))/no_coord", "parsedquery_toString":"+(+(text:testterm) +(text:2))", "explain":{}, "QParser":"ExtendedDismaxQParser", – acorntech Aug 16 '17 at 03:11