Strange behaviour building a query: SynonymQuery

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Strange behaviour building a query: SynonymQuery

rodio
Hi all,

This is my first question in this forum, i'm newbye with Solr so I would be
very glad if someone can resolve my doubt.

We are evaluating new version of Solr 8

The problem is that when we build a query using WordDelimiterFilterFactory
with preserveOriginal = 1, the parsed query has a behaviour not expected.

The example could be:

/name:(Whatever 7893GHT23)/

The parsed query returns:

/name:whatever Synonym(name:7893 name:7893ght23) name:ght name:23/

The expected parsed query must be:

/name:whatever Synonym(name:7893 name:7893ght23 name:ght name:23)/

We have tried to use synonymQueryStyle attribute with differents values in
TypeField without success, always get only two terms!!!


    /<fieldType name="text_general" synonymQueryStyle="as_same_term"
class="solr.TextField" positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt" />
        <filter class="solr.WordDelimiterFilterFactory"
generateWordParts="1" generateNumberParts="1" catenateWords="1"
catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"
splitOnNumerics="1" preserveOriginal="1"/>
        <filter class="solr.FlattenGraphFilterFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.ASCIIFoldingFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt" />
        <filter class="solr.WordDelimiterFilterFactory"
generateWordParts="1" generateNumberParts="1" catenateWords="0"
catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"
splitOnNumerics="1" preserveOriginal="1"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.ASCIIFoldingFilterFactory"/>
      </analyzer>
    </fieldType>/

We have an old Solr (version 3.6), that builds the query properly:

/name:whatever (name:7893ght23 name:7893 name:ght name:23)/

It would be great if anyone knows what could be happen

Thanks in advance!!!






--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Reply | Threaded
Open this post in threaded view
|

Re: Strange behaviour building a query: SynonymQuery

rodio
Hi all!

It's solved!

I have seen that we are using a deprecated version!

Use WordDelimiterGraphFilterFactory instead of WordDelimiterFilterFactory
solves the problem

https://lucene.apache.org/solr/guide/7_2/filter-descriptions.html#word-delimiter-filter
https://lucene.apache.org/solr/guide/7_2/filter-descriptions.html#word-delimiter-graph-filter 

name:whatever (name:7893ght23 (+name:7893 +name:ght +name:23))

Regards






--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Reply | Threaded
Open this post in threaded view
|

Re: Strange behaviour building a query: SynonymQuery

Erick Erickson
Thanks for letting us know!

> On Apr 4, 2019, at 8:40 AM, rodio <[hidden email]> wrote:
>
> Hi all!
>
> It's solved!
>
> I have seen that we are using a deprecated version!
>
> Use WordDelimiterGraphFilterFactory instead of WordDelimiterFilterFactory
> solves the problem
>
> https://lucene.apache.org/solr/guide/7_2/filter-descriptions.html#word-delimiter-filter
> https://lucene.apache.org/solr/guide/7_2/filter-descriptions.html#word-delimiter-graph-filter 
>
> name:whatever (name:7893ght23 (+name:7893 +name:ght +name:23))
>
> Regards
>
>
>
>
>
>
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html