You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Diogo Leão <di...@gmail.com> on 2017/06/29 11:13:36 UTC

Issue with SynonymGraphFilterFactory

Hello,

I have recently started using query-time synonym searching, and hava
configured a field with the SynonymGraphFilterFactory to handle multi-term
synonyms. All has worked well for simple (non quoted) queries, as well as
for exact sequences (quoted) queries.
However, I do not seem to get synonyms working with phrase proximity
queries.

For example, if I search for:
"mother grandmother"~8 and there is a file indexed with the content "Then
my mother and my grandmother went outside".

It would normally find fields where mother and grandmother are up to 8
words apart, matching the file above.
However, if "grandmother" has "grand mother" configured as a synonym, the
proximity search won't return anything (either searching "mother
grandmother"~8 or "mother grand mother"~8)
Searching for "mother and my grandmother"~8 returns the correct result.

Is it a known bug that SynonymGraphFilterFactory doesn't handle phrase
proximity searches?

Here are my configurations:

Solr-6.6.0

<fieldType name="text_pt_synonyms_ascii_minimal_lightStem"
class="solr.TextField" positionIncrementGap="100">

<analyzer type="index">

<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.StopFilterFactory" format="snowball"
words="lang/stopwords_pt.txt" ignoreCase="true"/>
<filter class="solr.PortugueseLightStemFilterFactory"/></analyzer>

<analyzer type="query">

<tokenizer class="solr.StandardTokenizerFactory"/><filter
class="solr.LowerCaseFilterFactory"/>
<filter class="solr.StopFilterFactory" format="snowball"
words="lang/stopwords_pt.txt" ignoreCase="true"/><filter
class="solr.ASCIIFoldingFilterFactory" preserveOriginal="true"/>
<filter class="solr.SynonymGraphFilterFactory" expand="true"
ignoreCase="true" synonyms="synonyms_radex.txt"/>
<filter class="solr.PortugueseLightStemFilterFactory"/></analyzer>

</fieldType>


Thank you

Diogo

Re: Issue with SynonymGraphFilterFactory

Posted by Diogo Edelmuth <di...@gmail.com>.
Opened:
https://issues.apache.org/jira/plugins/servlet/mobile#issue/SOLR-10980

Let me know I marked something inappropriately.

Diogo

> Em 29 de jun de 2017, às 18:54, Steve Rowe <sa...@gmail.com> escreveu:
> 
> Hi Diogo,
> 
> That sounds like a bug to me.  Would you mind filing a JIRA?
> 
> --
> Steve
> www.lucidworks.com
> 
>> On Jun 29, 2017, at 4:46 PM, diogo <di...@gmail.com> wrote:
>> 
>> I just checked debug=query
>> 
>> Seems like spanNearQuery function is getting the slope parameter as 0, no
>> matter what comes after the tilde:
>> 
>> "parsedquery":"SpanNearQuery(spanNear([laudo:mother,
>> spanOr([laudo:hipoatenuaca, laudo:hipodens])],* 0*, true))"
>> 
>> For searching: "mother grandmother"~8 or "mother grandmother"~1000
>> 
>> synonyms.txt has: 
>> mother, grand mother
>> 
>> When I search for words whose synonyms are not multi-word, MultiPhraseQuery
>> is used, instead of SpanNearQuery:
>> "MultiPhraseQuery(laudo:\"father (grandfather granddad)\"~10)"
>> 
>> synonyms.txt has:
>> grandfather, granddad
>> 
>> Is ther a way to change the slope on the first case with Solr API?
>> 
>> Thanks
>> 
>> 
>> 
>> --
>> View this message in context: http://lucene.472066.n3.nabble.com/Issue-with-SynonymGraphFilterFactory-tp4343400p4343544.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
> 

Re: Issue with SynonymGraphFilterFactory

Posted by Steve Rowe <sa...@gmail.com>.
Hi Diogo,

That sounds like a bug to me.  Would you mind filing a JIRA?

--
Steve
www.lucidworks.com

> On Jun 29, 2017, at 4:46 PM, diogo <di...@gmail.com> wrote:
> 
> I just checked debug=query
> 
> Seems like spanNearQuery function is getting the slope parameter as 0, no
> matter what comes after the tilde:
> 
> "parsedquery":"SpanNearQuery(spanNear([laudo:mother,
> spanOr([laudo:hipoatenuaca, laudo:hipodens])],* 0*, true))"
> 
> For searching: "mother grandmother"~8 or "mother grandmother"~1000
> 
> synonyms.txt has: 
> mother, grand mother
> 
> When I search for words whose synonyms are not multi-word, MultiPhraseQuery
> is used, instead of SpanNearQuery:
> "MultiPhraseQuery(laudo:\"father (grandfather granddad)\"~10)"
> 
> synonyms.txt has:
> grandfather, granddad
> 
> Is ther a way to change the slope on the first case with Solr API?
> 
> Thanks
> 
> 
> 
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Issue-with-SynonymGraphFilterFactory-tp4343400p4343544.html
> Sent from the Solr - User mailing list archive at Nabble.com.


Re: Issue with SynonymGraphFilterFactory

Posted by diogo <di...@gmail.com>.
I just checked debug=query

Seems like spanNearQuery function is getting the slope parameter as 0, no
matter what comes after the tilde:

"parsedquery":"SpanNearQuery(spanNear([laudo:mother,
spanOr([laudo:hipoatenuaca, laudo:hipodens])],* 0*, true))"

For searching: "mother grandmother"~8 or "mother grandmother"~1000

synonyms.txt has: 
mother, grand mother

When I search for words whose synonyms are not multi-word, MultiPhraseQuery
is used, instead of SpanNearQuery:
"MultiPhraseQuery(laudo:\"father (grandfather granddad)\"~10)"

synonyms.txt has:
grandfather, granddad

Is ther a way to change the slope on the first case with Solr API?

Thanks



--
View this message in context: http://lucene.472066.n3.nabble.com/Issue-with-SynonymGraphFilterFactory-tp4343400p4343544.html
Sent from the Solr - User mailing list archive at Nabble.com.