0
votes

I'm using solr 1.4 and solr 4 for fulltext-search inside documents. At the moment I'm unable to search whole phrases, like "The dog runs" at the textblock: "The dog runs through the house." For this testcase I use an simple solr URL: http://plocalhost:8088/solr/select/?start=0&q="the dog runs"

I'm using an tokenized, stemmed textfiled with the following options:

<fieldType name="text_de" class="solr.TextField" positionIncrementGap="100">
  <analyzer type="index">
    <tokenizer class="solr.StandardTokenizerFactory"/>
    <filter class="solr.LowerCaseFilterFactory"/>
    <filter class="solr.StopFilterFactory"
            ignoreCase="true"
            words="stopwords-de.txt"
            enablePositionIncrements="true"
            />
    <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
    <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
    <filter class="solr.SnowballPorterFilterFactory" language="German" />
  </analyzer>
  <analyzer type="query">
    <tokenizer class="solr.StandardTokenizerFactory"/>
    <filter class="solr.SynonymFilterFactory" synonyms="synonyms-de.txt" ignoreCase="true" expand="true"/>
    <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
    <filter class="solr.LowerCaseFilterFactory"/>
    <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
    <filter class="solr.SnowballPorterFilterFactory" language="German" />
  </analyzer>
</fieldType>

I have no idea, why it's not working. :-( ...thank you for any hint.

1
How are you using Solr 1.4 and Solr 4.X at the same time? I don't understand why or how.mt3
how: I'm using different tomcat installations at the same server (development system). why: for running different versions of an application - old (current) version using 1.4 for bug-fixing and new version using 4.x (which is in development)The Bndr
OK, I see. Original description wasn't clear. It sounded like you were indexing with 1.4 and then querying with 4.X.mt3

1 Answers

2
votes

To answer my own question:

The analyzer on index time is using a stopwords list, while the analyzer on query time does NOT use a stopword list. So the phrase in the index was not the same as the phrase on query time.

I only had to add the StopFilterFactory at the "query"-analyzer.