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 Ennio Bozzetti <EB...@thorlabs.com> on 2018/07/17 15:35:36 UTC
synonyms question
I'm trying to get my synonyms to work, but for this one keyword I cannot get it to work.
I added the following to my synonyms file.
fiber,fibre
But when I search for fiber or fibre it does not work.
Fiber is the American English spelling and Fibre is the British English spelling.
My field type is set to text_en would that be why?
Thanks,
Ennio Bozzetti
Senior Web Programmer
THORLABS
(973) 300-2561
www.thorlabs.com<https://www.thorlabs.com/>
Re: synonyms question
Posted by Andrea Gazzarini <a....@sease.io>.
Hi Ennio,
could you please share:
* your configuration (specifically the field type declaration in your
schema)
* the query (please add debug=true) and the corresponding query response
Best,
Andrea
On 17/07/18 17:35, Ennio Bozzetti wrote:
> I'm trying to get my synonyms to work, but for this one keyword I cannot get it to work.
>
> I added the following to my synonyms file.
>
> fiber,fibre
>
> But when I search for fiber or fibre it does not work.
>
> Fiber is the American English spelling and Fibre is the British English spelling.
>
> My field type is set to text_en would that be why?
>
> Thanks,
>
> Ennio Bozzetti
> Senior Web Programmer
> THORLABS
> (973) 300-2561
> www.thorlabs.com<https://www.thorlabs.com/>
>
>
Re: synonyms question
Posted by ennio <eb...@thorlabs.com>.
Vicenzo,
Thank you for the tip. I restarted Solr and it worked.
-Ennio
--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Re: synonyms question
Posted by Vincenzo D'Amore <v....@gmail.com>.
Have you reloaded the core (or restarted Solr) after the change in the synonyms file?
Ciao,
Vincenzo
--
mobile: 3498513251
skype: free.dev
> On 17 Jul 2018, at 20:04, ennio <eb...@thorlabs.com> wrote:
>
> No not using SolrCloud.
>
>
>
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Re: synonyms question
Posted by ennio <eb...@thorlabs.com>.
No not using SolrCloud.
--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Re: synonyms question
Posted by Vincenzo D'Amore <v....@gmail.com>.
Ennio, do you know if you have SolrCloud?
On Tue, Jul 17, 2018 at 7:19 PM ennio <eb...@thorlabs.com> wrote:
> Erick,
>
> I'm invoking the synonym at query time.
>
> Here is my fieldType definition.
>
> <fieldType name="text_en" class="solr.TextField"
> positionIncrementGap="100">
> <analyzer type="index">
> <tokenizer class="solr.StandardTokenizerFactory"/>
>
> <filter class="solr.StopFilterFactory"
> ignoreCase="true"
> words="lang/stopwords_en.txt"
> />
> <filter class="solr.LowerCaseFilterFactory"/>
> <filter class="solr.EnglishPossessiveFilterFactory"/>
> <filter class="solr.KeywordMarkerFilterFactory"
> protected="protwords.txt"/>
> <filter class="solr.PorterStemFilterFactory"/>
> </analyzer>
> <analyzer type="query">
> <tokenizer class="solr.StandardTokenizerFactory"/>
> <filter class="solr.SynonymGraphFilterFactory"
> synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
> <filter class="solr.StopFilterFactory"
> ignoreCase="true"
> words="lang/stopwords_en.txt"
> />
> <filter class="solr.LowerCaseFilterFactory"/>
> <filter class="solr.EnglishPossessiveFilterFactory"/>
> <filter class="solr.KeywordMarkerFilterFactory"
> protected="protwords.txt"/>
> <filter class="solr.PorterStemFilterFactory"/>
> </analyzer>
> </fieldType>
>
>
>
>
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
>
--
Vincenzo D'Amore
Re: synonyms question
Posted by ennio <eb...@thorlabs.com>.
Erick,
I'm invoking the synonym at query time.
Here is my fieldType definition.
<fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory"
ignoreCase="true"
words="lang/stopwords_en.txt"
/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPossessiveFilterFactory"/>
<filter class="solr.KeywordMarkerFilterFactory"
protected="protwords.txt"/>
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.SynonymGraphFilterFactory"
synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.StopFilterFactory"
ignoreCase="true"
words="lang/stopwords_en.txt"
/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPossessiveFilterFactory"/>
<filter class="solr.KeywordMarkerFilterFactory"
protected="protwords.txt"/>
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
</fieldType>
--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Re: synonyms question
Posted by Erick Erickson <er...@gmail.com>.
You have to look at the analysis chain for text_en. Is the synonym
factory being invoked? If so at indexing time or query time? If
indexing time, did you have the synonym defined when you indexed the
data originally? If in cloud mode did you push the configs to
Zookeeper and reload the collection before indexing and/or querying?
The admin UI>>collection>>analysis page is very helpful.
Best,
Erick
On Tue, Jul 17, 2018 at 8:35 AM, Ennio Bozzetti <EB...@thorlabs.com> wrote:
> I'm trying to get my synonyms to work, but for this one keyword I cannot get it to work.
>
> I added the following to my synonyms file.
>
> fiber,fibre
>
> But when I search for fiber or fibre it does not work.
>
> Fiber is the American English spelling and Fibre is the British English spelling.
>
> My field type is set to text_en would that be why?
>
> Thanks,
>
> Ennio Bozzetti
> Senior Web Programmer
> THORLABS
> (973) 300-2561
> www.thorlabs.com<https://www.thorlabs.com/>
>