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 Abhi Basu <90...@gmail.com> on 2018/03/01 17:23:53 UTC

Synonym not working in 4.10 / CDH 5.14

 Can someone please help me?

Schema.xml

<field name="PropertyAddressState" type="string" indexed="true"
stored="true" docValues="true"/>

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


<copyfield source="PropertyAddressState" dest="text"/>


<fieldType name="text_general" class="solr.TextField"
positionIncrementGap="100">
  <analyzer type="index">
    <tokenizer class="solr.StandardTokenizerFactory"/>
    <filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt" />
    <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="true"
tokenizerFactory="solr.StandardTokenizerFactory"/>
    <filter class="solr.LowerCaseFilterFactory"/>
  </analyzer>
  <analyzer type="query">
    <tokenizer class="solr.StandardTokenizerFactory"/>
    <filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt" />
    <!--filter class="solr.SynonymFilterFactory"
synonyms="synonyms.txt" ignoreCase="true" expand="true"/-->
    <filter class="solr.LowerCaseFilterFactory"/>
  </analyzer>
</fieldType>




Synonyms.txt has been populated with State abbreviations and names.


When searching for

PropertyAddressState:"Oregon", I do not find docs with "OR".



What am I missing?


Thanks,

Abhi

Re: Synonym not working in 4.10 / CDH 5.14

Posted by Abhi Basu <90...@gmail.com>.
Thanks for your help.

Abhi

On Thu, Mar 1, 2018 at 2:06 PM, Steve Rowe <sa...@gmail.com> wrote:

> Yes, either type “text_general” or some other TextField-based field type
> that includes a synonym filter.
>
> --
> Steve
> www.lucidworks.com
>
> > On Mar 1, 2018, at 3:02 PM, Abhi Basu <90...@gmail.com> wrote:
> >
> > Yes, agreed. Just tested and it works. :)
> >
> > I will have a lot more fields, so every field I need a synonym feature
> for
> > will have to be type "text_general", right?
> >
> > On Thu, Mar 1, 2018 at 1:57 PM, Steve Rowe <sa...@gmail.com> wrote:
> >
> >> I think you want type=“text_general”
> >>
> >> --
> >> Steve
> >> www.lucidworks.com
> >>
> >>> On Mar 1, 2018, at 2:19 PM, Abhi Basu <90...@gmail.com> wrote:
> >>>
> >>> Should it be defined as this instead?
> >>>
> >>> <field name="PropertyAddressState" type="text" indexed="true"
> >>> stored="true" docValues="true"/>
> >>>
> >>>
> >>>
> >>> On Thu, Mar 1, 2018 at 1:16 PM, Abhi Basu <90...@gmail.com> wrote:
> >>>
> >>>> What should PropertyAddressState type be in order to be caught into
> the
> >>>> text_general config below?
> >>>>
> >>>> I have remeoved the copyfield now.
> >>>>
> >>>> <field name="PropertyAddressState" type="string" indexed="true"
> >> stored="true" docValues="true"/>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> <fieldType name="text_general" class="solr.TextField"
> >> positionIncrementGap="100">
> >>>> <analyzer type="index">
> >>>>   <tokenizer class="solr.StandardTokenizerFactory"/>
> >>>>   <filter class="solr.StopFilterFactory" ignoreCase="true"
> >> words="stopwords.txt" />
> >>>>   <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
> >> ignoreCase="true" expand="true" tokenizerFactory="solr.
> >> StandardTokenizerFactory"/>
> >>>>   <filter class="solr.LowerCaseFilterFactory"/>
> >>>> </analyzer>
> >>>> <analyzer type="query">
> >>>>   <tokenizer class="solr.StandardTokenizerFactory"/>
> >>>>   <filter class="solr.StopFilterFactory" ignoreCase="true"
> >> words="stopwords.txt" />
> >>>>   <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
> >> ignoreCase="true" expand="true"/>
> >>>>   <filter class="solr.LowerCaseFilterFactory"/>
> >>>> </analyzer>
> >>>> </fieldType>
> >>>>
> >>>>
> >>>>
> >>>> On Thu, Mar 1, 2018 at 1:12 PM, Steve Rowe <sa...@gmail.com> wrote:
> >>>>
> >>>>> Hi Abhi,
> >>>>>
> >>>>> PropertyAddressState is of type “string”, which has no analysis
> >> applied.
> >>>>>
> >>>>> Since you copyfield to “text” field, which has the analysis you
> expect,
> >>>>> you could try querying it instead.
> >>>>>
> >>>>> --
> >>>>> Steve
> >>>>> www.lucidworks.com
> >>>>>
> >>>>>> On Mar 1, 2018, at 12:23 PM, Abhi Basu <90...@gmail.com> wrote:
> >>>>>>
> >>>>>> Can someone please help me?
> >>>>>>
> >>>>>> Schema.xml
> >>>>>>
> >>>>>> <field name="PropertyAddressState" type="string" indexed="true"
> >>>>>> stored="true" docValues="true"/>
> >>>>>>
> >>>>>> <field name="text" type="text_general" indexed="true" stored="false"
> >>>>>> multiValued="true"/>
> >>>>>>
> >>>>>>
> >>>>>> <copyfield source="PropertyAddressState" dest="text"/>
> >>>>>>
> >>>>>>
> >>>>>> <fieldType name="text_general" class="solr.TextField"
> >>>>>> positionIncrementGap="100">
> >>>>>> <analyzer type="index">
> >>>>>>  <tokenizer class="solr.StandardTokenizerFactory"/>
> >>>>>>  <filter class="solr.StopFilterFactory" ignoreCase="true"
> >>>>>> words="stopwords.txt" />
> >>>>>>  <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
> >>>>>> ignoreCase="true" expand="true"
> >>>>>> tokenizerFactory="solr.StandardTokenizerFactory"/>
> >>>>>>  <filter class="solr.LowerCaseFilterFactory"/>
> >>>>>> </analyzer>
> >>>>>> <analyzer type="query">
> >>>>>>  <tokenizer class="solr.StandardTokenizerFactory"/>
> >>>>>>  <filter class="solr.StopFilterFactory" ignoreCase="true"
> >>>>>> words="stopwords.txt" />
> >>>>>>  <!--filter class="solr.SynonymFilterFactory"
> >>>>>> synonyms="synonyms.txt" ignoreCase="true" expand="true"/-->
> >>>>>>  <filter class="solr.LowerCaseFilterFactory"/>
> >>>>>> </analyzer>
> >>>>>> </fieldType>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> Synonyms.txt has been populated with State abbreviations and names.
> >>>>>>
> >>>>>>
> >>>>>> When searching for
> >>>>>>
> >>>>>> PropertyAddressState:"Oregon", I do not find docs with "OR".
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> What am I missing?
> >>>>>>
> >>>>>>
> >>>>>> Thanks,
> >>>>>>
> >>>>>> Abhi
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>> --
> >>>> Abhi Basu
> >>>>
> >>>
> >>>
> >>>
> >>> --
> >>> Abhi Basu
> >>
> >>
> >
> >
> > --
> > Abhi Basu
>
>


-- 
Abhi Basu

Re: Synonym not working in 4.10 / CDH 5.14

Posted by Steve Rowe <sa...@gmail.com>.
Yes, either type “text_general” or some other TextField-based field type that includes a synonym filter.

--
Steve
www.lucidworks.com

> On Mar 1, 2018, at 3:02 PM, Abhi Basu <90...@gmail.com> wrote:
> 
> Yes, agreed. Just tested and it works. :)
> 
> I will have a lot more fields, so every field I need a synonym feature for
> will have to be type "text_general", right?
> 
> On Thu, Mar 1, 2018 at 1:57 PM, Steve Rowe <sa...@gmail.com> wrote:
> 
>> I think you want type=“text_general”
>> 
>> --
>> Steve
>> www.lucidworks.com
>> 
>>> On Mar 1, 2018, at 2:19 PM, Abhi Basu <90...@gmail.com> wrote:
>>> 
>>> Should it be defined as this instead?
>>> 
>>> <field name="PropertyAddressState" type="text" indexed="true"
>>> stored="true" docValues="true"/>
>>> 
>>> 
>>> 
>>> On Thu, Mar 1, 2018 at 1:16 PM, Abhi Basu <90...@gmail.com> wrote:
>>> 
>>>> What should PropertyAddressState type be in order to be caught into the
>>>> text_general config below?
>>>> 
>>>> I have remeoved the copyfield now.
>>>> 
>>>> <field name="PropertyAddressState" type="string" indexed="true"
>> stored="true" docValues="true"/>
>>>> 
>>>> 
>>>> 
>>>> 
>>>> <fieldType name="text_general" class="solr.TextField"
>> positionIncrementGap="100">
>>>> <analyzer type="index">
>>>>   <tokenizer class="solr.StandardTokenizerFactory"/>
>>>>   <filter class="solr.StopFilterFactory" ignoreCase="true"
>> words="stopwords.txt" />
>>>>   <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
>> ignoreCase="true" expand="true" tokenizerFactory="solr.
>> StandardTokenizerFactory"/>
>>>>   <filter class="solr.LowerCaseFilterFactory"/>
>>>> </analyzer>
>>>> <analyzer type="query">
>>>>   <tokenizer class="solr.StandardTokenizerFactory"/>
>>>>   <filter class="solr.StopFilterFactory" ignoreCase="true"
>> words="stopwords.txt" />
>>>>   <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
>> ignoreCase="true" expand="true"/>
>>>>   <filter class="solr.LowerCaseFilterFactory"/>
>>>> </analyzer>
>>>> </fieldType>
>>>> 
>>>> 
>>>> 
>>>> On Thu, Mar 1, 2018 at 1:12 PM, Steve Rowe <sa...@gmail.com> wrote:
>>>> 
>>>>> Hi Abhi,
>>>>> 
>>>>> PropertyAddressState is of type “string”, which has no analysis
>> applied.
>>>>> 
>>>>> Since you copyfield to “text” field, which has the analysis you expect,
>>>>> you could try querying it instead.
>>>>> 
>>>>> --
>>>>> Steve
>>>>> www.lucidworks.com
>>>>> 
>>>>>> On Mar 1, 2018, at 12:23 PM, Abhi Basu <90...@gmail.com> wrote:
>>>>>> 
>>>>>> Can someone please help me?
>>>>>> 
>>>>>> Schema.xml
>>>>>> 
>>>>>> <field name="PropertyAddressState" type="string" indexed="true"
>>>>>> stored="true" docValues="true"/>
>>>>>> 
>>>>>> <field name="text" type="text_general" indexed="true" stored="false"
>>>>>> multiValued="true"/>
>>>>>> 
>>>>>> 
>>>>>> <copyfield source="PropertyAddressState" dest="text"/>
>>>>>> 
>>>>>> 
>>>>>> <fieldType name="text_general" class="solr.TextField"
>>>>>> positionIncrementGap="100">
>>>>>> <analyzer type="index">
>>>>>>  <tokenizer class="solr.StandardTokenizerFactory"/>
>>>>>>  <filter class="solr.StopFilterFactory" ignoreCase="true"
>>>>>> words="stopwords.txt" />
>>>>>>  <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
>>>>>> ignoreCase="true" expand="true"
>>>>>> tokenizerFactory="solr.StandardTokenizerFactory"/>
>>>>>>  <filter class="solr.LowerCaseFilterFactory"/>
>>>>>> </analyzer>
>>>>>> <analyzer type="query">
>>>>>>  <tokenizer class="solr.StandardTokenizerFactory"/>
>>>>>>  <filter class="solr.StopFilterFactory" ignoreCase="true"
>>>>>> words="stopwords.txt" />
>>>>>>  <!--filter class="solr.SynonymFilterFactory"
>>>>>> synonyms="synonyms.txt" ignoreCase="true" expand="true"/-->
>>>>>>  <filter class="solr.LowerCaseFilterFactory"/>
>>>>>> </analyzer>
>>>>>> </fieldType>
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> Synonyms.txt has been populated with State abbreviations and names.
>>>>>> 
>>>>>> 
>>>>>> When searching for
>>>>>> 
>>>>>> PropertyAddressState:"Oregon", I do not find docs with "OR".
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> What am I missing?
>>>>>> 
>>>>>> 
>>>>>> Thanks,
>>>>>> 
>>>>>> Abhi
>>>>> 
>>>>> 
>>>> 
>>>> 
>>>> --
>>>> Abhi Basu
>>>> 
>>> 
>>> 
>>> 
>>> --
>>> Abhi Basu
>> 
>> 
> 
> 
> -- 
> Abhi Basu


Re: Synonym not working in 4.10 / CDH 5.14

Posted by Abhi Basu <90...@gmail.com>.
Yes, agreed. Just tested and it works. :)

I will have a lot more fields, so every field I need a synonym feature for
will have to be type "text_general", right?

On Thu, Mar 1, 2018 at 1:57 PM, Steve Rowe <sa...@gmail.com> wrote:

> I think you want type=“text_general”
>
> --
> Steve
> www.lucidworks.com
>
> > On Mar 1, 2018, at 2:19 PM, Abhi Basu <90...@gmail.com> wrote:
> >
> > Should it be defined as this instead?
> >
> > <field name="PropertyAddressState" type="text" indexed="true"
> > stored="true" docValues="true"/>
> >
> >
> >
> > On Thu, Mar 1, 2018 at 1:16 PM, Abhi Basu <90...@gmail.com> wrote:
> >
> >> What should PropertyAddressState type be in order to be caught into the
> >> text_general config below?
> >>
> >> I have remeoved the copyfield now.
> >>
> >> <field name="PropertyAddressState" type="string" indexed="true"
> stored="true" docValues="true"/>
> >>
> >>
> >>
> >>
> >> <fieldType name="text_general" class="solr.TextField"
> positionIncrementGap="100">
> >>  <analyzer type="index">
> >>    <tokenizer class="solr.StandardTokenizerFactory"/>
> >>    <filter class="solr.StopFilterFactory" ignoreCase="true"
> words="stopwords.txt" />
> >>    <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
> ignoreCase="true" expand="true" tokenizerFactory="solr.
> StandardTokenizerFactory"/>
> >>    <filter class="solr.LowerCaseFilterFactory"/>
> >>  </analyzer>
> >>  <analyzer type="query">
> >>    <tokenizer class="solr.StandardTokenizerFactory"/>
> >>    <filter class="solr.StopFilterFactory" ignoreCase="true"
> words="stopwords.txt" />
> >>    <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
> ignoreCase="true" expand="true"/>
> >>    <filter class="solr.LowerCaseFilterFactory"/>
> >>  </analyzer>
> >> </fieldType>
> >>
> >>
> >>
> >> On Thu, Mar 1, 2018 at 1:12 PM, Steve Rowe <sa...@gmail.com> wrote:
> >>
> >>> Hi Abhi,
> >>>
> >>> PropertyAddressState is of type “string”, which has no analysis
> applied.
> >>>
> >>> Since you copyfield to “text” field, which has the analysis you expect,
> >>> you could try querying it instead.
> >>>
> >>> --
> >>> Steve
> >>> www.lucidworks.com
> >>>
> >>>> On Mar 1, 2018, at 12:23 PM, Abhi Basu <90...@gmail.com> wrote:
> >>>>
> >>>> Can someone please help me?
> >>>>
> >>>> Schema.xml
> >>>>
> >>>> <field name="PropertyAddressState" type="string" indexed="true"
> >>>> stored="true" docValues="true"/>
> >>>>
> >>>> <field name="text" type="text_general" indexed="true" stored="false"
> >>>> multiValued="true"/>
> >>>>
> >>>>
> >>>> <copyfield source="PropertyAddressState" dest="text"/>
> >>>>
> >>>>
> >>>> <fieldType name="text_general" class="solr.TextField"
> >>>> positionIncrementGap="100">
> >>>> <analyzer type="index">
> >>>>   <tokenizer class="solr.StandardTokenizerFactory"/>
> >>>>   <filter class="solr.StopFilterFactory" ignoreCase="true"
> >>>> words="stopwords.txt" />
> >>>>   <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
> >>>> ignoreCase="true" expand="true"
> >>>> tokenizerFactory="solr.StandardTokenizerFactory"/>
> >>>>   <filter class="solr.LowerCaseFilterFactory"/>
> >>>> </analyzer>
> >>>> <analyzer type="query">
> >>>>   <tokenizer class="solr.StandardTokenizerFactory"/>
> >>>>   <filter class="solr.StopFilterFactory" ignoreCase="true"
> >>>> words="stopwords.txt" />
> >>>>   <!--filter class="solr.SynonymFilterFactory"
> >>>> synonyms="synonyms.txt" ignoreCase="true" expand="true"/-->
> >>>>   <filter class="solr.LowerCaseFilterFactory"/>
> >>>> </analyzer>
> >>>> </fieldType>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> Synonyms.txt has been populated with State abbreviations and names.
> >>>>
> >>>>
> >>>> When searching for
> >>>>
> >>>> PropertyAddressState:"Oregon", I do not find docs with "OR".
> >>>>
> >>>>
> >>>>
> >>>> What am I missing?
> >>>>
> >>>>
> >>>> Thanks,
> >>>>
> >>>> Abhi
> >>>
> >>>
> >>
> >>
> >> --
> >> Abhi Basu
> >>
> >
> >
> >
> > --
> > Abhi Basu
>
>


-- 
Abhi Basu

Re: Synonym not working in 4.10 / CDH 5.14

Posted by Steve Rowe <sa...@gmail.com>.
I think you want type=“text_general”

--
Steve
www.lucidworks.com

> On Mar 1, 2018, at 2:19 PM, Abhi Basu <90...@gmail.com> wrote:
> 
> Should it be defined as this instead?
> 
> <field name="PropertyAddressState" type="text" indexed="true"
> stored="true" docValues="true"/>
> 
> 
> 
> On Thu, Mar 1, 2018 at 1:16 PM, Abhi Basu <90...@gmail.com> wrote:
> 
>> What should PropertyAddressState type be in order to be caught into the
>> text_general config below?
>> 
>> I have remeoved the copyfield now.
>> 
>> <field name="PropertyAddressState" type="string" indexed="true" stored="true" docValues="true"/>
>> 
>> 
>> 
>> 
>> <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
>>  <analyzer type="index">
>>    <tokenizer class="solr.StandardTokenizerFactory"/>
>>    <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
>>    <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true" tokenizerFactory="solr.StandardTokenizerFactory"/>
>>    <filter class="solr.LowerCaseFilterFactory"/>
>>  </analyzer>
>>  <analyzer type="query">
>>    <tokenizer class="solr.StandardTokenizerFactory"/>
>>    <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
>>    <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
>>    <filter class="solr.LowerCaseFilterFactory"/>
>>  </analyzer>
>> </fieldType>
>> 
>> 
>> 
>> On Thu, Mar 1, 2018 at 1:12 PM, Steve Rowe <sa...@gmail.com> wrote:
>> 
>>> Hi Abhi,
>>> 
>>> PropertyAddressState is of type “string”, which has no analysis applied.
>>> 
>>> Since you copyfield to “text” field, which has the analysis you expect,
>>> you could try querying it instead.
>>> 
>>> --
>>> Steve
>>> www.lucidworks.com
>>> 
>>>> On Mar 1, 2018, at 12:23 PM, Abhi Basu <90...@gmail.com> wrote:
>>>> 
>>>> Can someone please help me?
>>>> 
>>>> Schema.xml
>>>> 
>>>> <field name="PropertyAddressState" type="string" indexed="true"
>>>> stored="true" docValues="true"/>
>>>> 
>>>> <field name="text" type="text_general" indexed="true" stored="false"
>>>> multiValued="true"/>
>>>> 
>>>> 
>>>> <copyfield source="PropertyAddressState" dest="text"/>
>>>> 
>>>> 
>>>> <fieldType name="text_general" class="solr.TextField"
>>>> positionIncrementGap="100">
>>>> <analyzer type="index">
>>>>   <tokenizer class="solr.StandardTokenizerFactory"/>
>>>>   <filter class="solr.StopFilterFactory" ignoreCase="true"
>>>> words="stopwords.txt" />
>>>>   <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
>>>> ignoreCase="true" expand="true"
>>>> tokenizerFactory="solr.StandardTokenizerFactory"/>
>>>>   <filter class="solr.LowerCaseFilterFactory"/>
>>>> </analyzer>
>>>> <analyzer type="query">
>>>>   <tokenizer class="solr.StandardTokenizerFactory"/>
>>>>   <filter class="solr.StopFilterFactory" ignoreCase="true"
>>>> words="stopwords.txt" />
>>>>   <!--filter class="solr.SynonymFilterFactory"
>>>> synonyms="synonyms.txt" ignoreCase="true" expand="true"/-->
>>>>   <filter class="solr.LowerCaseFilterFactory"/>
>>>> </analyzer>
>>>> </fieldType>
>>>> 
>>>> 
>>>> 
>>>> 
>>>> Synonyms.txt has been populated with State abbreviations and names.
>>>> 
>>>> 
>>>> When searching for
>>>> 
>>>> PropertyAddressState:"Oregon", I do not find docs with "OR".
>>>> 
>>>> 
>>>> 
>>>> What am I missing?
>>>> 
>>>> 
>>>> Thanks,
>>>> 
>>>> Abhi
>>> 
>>> 
>> 
>> 
>> --
>> Abhi Basu
>> 
> 
> 
> 
> -- 
> Abhi Basu


Re: Synonym not working in 4.10 / CDH 5.14

Posted by Abhi Basu <90...@gmail.com>.
Should it be defined as this instead?

<field name="PropertyAddressState" type="text" indexed="true"
stored="true" docValues="true"/>



On Thu, Mar 1, 2018 at 1:16 PM, Abhi Basu <90...@gmail.com> wrote:

> What should PropertyAddressState type be in order to be caught into the
> text_general config below?
>
> I have remeoved the copyfield now.
>
> <field name="PropertyAddressState" type="string" indexed="true" stored="true" docValues="true"/>
>
>
>
>
> <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
>   <analyzer type="index">
>     <tokenizer class="solr.StandardTokenizerFactory"/>
>     <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
>     <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true" tokenizerFactory="solr.StandardTokenizerFactory"/>
>     <filter class="solr.LowerCaseFilterFactory"/>
>   </analyzer>
>   <analyzer type="query">
>     <tokenizer class="solr.StandardTokenizerFactory"/>
>     <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
>     <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
>     <filter class="solr.LowerCaseFilterFactory"/>
>   </analyzer>
> </fieldType>
>
>
>
> On Thu, Mar 1, 2018 at 1:12 PM, Steve Rowe <sa...@gmail.com> wrote:
>
>> Hi Abhi,
>>
>> PropertyAddressState is of type “string”, which has no analysis applied.
>>
>> Since you copyfield to “text” field, which has the analysis you expect,
>> you could try querying it instead.
>>
>> --
>> Steve
>> www.lucidworks.com
>>
>> > On Mar 1, 2018, at 12:23 PM, Abhi Basu <90...@gmail.com> wrote:
>> >
>> > Can someone please help me?
>> >
>> > Schema.xml
>> >
>> > <field name="PropertyAddressState" type="string" indexed="true"
>> > stored="true" docValues="true"/>
>> >
>> > <field name="text" type="text_general" indexed="true" stored="false"
>> > multiValued="true"/>
>> >
>> >
>> > <copyfield source="PropertyAddressState" dest="text"/>
>> >
>> >
>> > <fieldType name="text_general" class="solr.TextField"
>> > positionIncrementGap="100">
>> >  <analyzer type="index">
>> >    <tokenizer class="solr.StandardTokenizerFactory"/>
>> >    <filter class="solr.StopFilterFactory" ignoreCase="true"
>> > words="stopwords.txt" />
>> >    <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
>> > ignoreCase="true" expand="true"
>> > tokenizerFactory="solr.StandardTokenizerFactory"/>
>> >    <filter class="solr.LowerCaseFilterFactory"/>
>> >  </analyzer>
>> >  <analyzer type="query">
>> >    <tokenizer class="solr.StandardTokenizerFactory"/>
>> >    <filter class="solr.StopFilterFactory" ignoreCase="true"
>> > words="stopwords.txt" />
>> >    <!--filter class="solr.SynonymFilterFactory"
>> > synonyms="synonyms.txt" ignoreCase="true" expand="true"/-->
>> >    <filter class="solr.LowerCaseFilterFactory"/>
>> >  </analyzer>
>> > </fieldType>
>> >
>> >
>> >
>> >
>> > Synonyms.txt has been populated with State abbreviations and names.
>> >
>> >
>> > When searching for
>> >
>> > PropertyAddressState:"Oregon", I do not find docs with "OR".
>> >
>> >
>> >
>> > What am I missing?
>> >
>> >
>> > Thanks,
>> >
>> > Abhi
>>
>>
>
>
> --
> Abhi Basu
>



-- 
Abhi Basu

Re: Synonym not working in 4.10 / CDH 5.14

Posted by Abhi Basu <90...@gmail.com>.
What should PropertyAddressState type be in order to be caught into the
text_general config below?

I have remeoved the copyfield now.

<field name="PropertyAddressState" type="string" indexed="true"
stored="true" docValues="true"/>




<fieldType name="text_general" class="solr.TextField"
positionIncrementGap="100">
  <analyzer type="index">
    <tokenizer class="solr.StandardTokenizerFactory"/>
    <filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt" />
    <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="true"
tokenizerFactory="solr.StandardTokenizerFactory"/>
    <filter class="solr.LowerCaseFilterFactory"/>
  </analyzer>
  <analyzer type="query">
    <tokenizer class="solr.StandardTokenizerFactory"/>
    <filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt" />
    <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="true"/>
    <filter class="solr.LowerCaseFilterFactory"/>
  </analyzer>
</fieldType>



On Thu, Mar 1, 2018 at 1:12 PM, Steve Rowe <sa...@gmail.com> wrote:

> Hi Abhi,
>
> PropertyAddressState is of type “string”, which has no analysis applied.
>
> Since you copyfield to “text” field, which has the analysis you expect,
> you could try querying it instead.
>
> --
> Steve
> www.lucidworks.com
>
> > On Mar 1, 2018, at 12:23 PM, Abhi Basu <90...@gmail.com> wrote:
> >
> > Can someone please help me?
> >
> > Schema.xml
> >
> > <field name="PropertyAddressState" type="string" indexed="true"
> > stored="true" docValues="true"/>
> >
> > <field name="text" type="text_general" indexed="true" stored="false"
> > multiValued="true"/>
> >
> >
> > <copyfield source="PropertyAddressState" dest="text"/>
> >
> >
> > <fieldType name="text_general" class="solr.TextField"
> > positionIncrementGap="100">
> >  <analyzer type="index">
> >    <tokenizer class="solr.StandardTokenizerFactory"/>
> >    <filter class="solr.StopFilterFactory" ignoreCase="true"
> > words="stopwords.txt" />
> >    <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
> > ignoreCase="true" expand="true"
> > tokenizerFactory="solr.StandardTokenizerFactory"/>
> >    <filter class="solr.LowerCaseFilterFactory"/>
> >  </analyzer>
> >  <analyzer type="query">
> >    <tokenizer class="solr.StandardTokenizerFactory"/>
> >    <filter class="solr.StopFilterFactory" ignoreCase="true"
> > words="stopwords.txt" />
> >    <!--filter class="solr.SynonymFilterFactory"
> > synonyms="synonyms.txt" ignoreCase="true" expand="true"/-->
> >    <filter class="solr.LowerCaseFilterFactory"/>
> >  </analyzer>
> > </fieldType>
> >
> >
> >
> >
> > Synonyms.txt has been populated with State abbreviations and names.
> >
> >
> > When searching for
> >
> > PropertyAddressState:"Oregon", I do not find docs with "OR".
> >
> >
> >
> > What am I missing?
> >
> >
> > Thanks,
> >
> > Abhi
>
>


-- 
Abhi Basu

Re: Synonym not working in 4.10 / CDH 5.14

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

PropertyAddressState is of type “string”, which has no analysis applied.

Since you copyfield to “text” field, which has the analysis you expect, you could try querying it instead.

--
Steve
www.lucidworks.com

> On Mar 1, 2018, at 12:23 PM, Abhi Basu <90...@gmail.com> wrote:
> 
> Can someone please help me?
> 
> Schema.xml
> 
> <field name="PropertyAddressState" type="string" indexed="true"
> stored="true" docValues="true"/>
> 
> <field name="text" type="text_general" indexed="true" stored="false"
> multiValued="true"/>
> 
> 
> <copyfield source="PropertyAddressState" dest="text"/>
> 
> 
> <fieldType name="text_general" class="solr.TextField"
> positionIncrementGap="100">
>  <analyzer type="index">
>    <tokenizer class="solr.StandardTokenizerFactory"/>
>    <filter class="solr.StopFilterFactory" ignoreCase="true"
> words="stopwords.txt" />
>    <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
> ignoreCase="true" expand="true"
> tokenizerFactory="solr.StandardTokenizerFactory"/>
>    <filter class="solr.LowerCaseFilterFactory"/>
>  </analyzer>
>  <analyzer type="query">
>    <tokenizer class="solr.StandardTokenizerFactory"/>
>    <filter class="solr.StopFilterFactory" ignoreCase="true"
> words="stopwords.txt" />
>    <!--filter class="solr.SynonymFilterFactory"
> synonyms="synonyms.txt" ignoreCase="true" expand="true"/-->
>    <filter class="solr.LowerCaseFilterFactory"/>
>  </analyzer>
> </fieldType>
> 
> 
> 
> 
> Synonyms.txt has been populated with State abbreviations and names.
> 
> 
> When searching for
> 
> PropertyAddressState:"Oregon", I do not find docs with "OR".
> 
> 
> 
> What am I missing?
> 
> 
> Thanks,
> 
> Abhi


Re: Synonym not working in 4.10 / CDH 5.14

Posted by Abhi Basu <90...@gmail.com>.
I am testing the index analyzer first. Do I need to turn on the query
analyzer too?

synonyms.txt

Alabama, AL
Alaska, AK
Arizona, AZ
Arkansas, AR
California, CA
Colorado, CO
Connecticut, CT
Delaware, DE
Florida, FL
Georgia, GA
Hawaii, HI
Idaho, ID
Illinois, IL
Indiana, IN
Iowa, IA

etc ...


On Thu, Mar 1, 2018 at 12:27 PM, Alessandro Hoss <al...@gmail.com> wrote:

> How's your synonyms declared in the file?
>
> That xml comment (<!-- -->) in the synonym filter section isn't there in
> your running solr schema.xml, right? :)
>
> On Thu, Mar 1, 2018 at 2:53 PM Abhi Basu <90...@gmail.com> wrote:
>
> > Yes have tested with PA and NY, nothing works.
> >
> > On Thu, Mar 1, 2018 at 11:38 AM, Alessandro Hoss <al...@gmail.com>
> > wrote:
> >
> > > Have you tested with another state?
> > >
> > > I'm asking because maybe solr is considering "OR" as a clause separator
> > > instead of a search term, and in this case the problem is not with
> > synonym,
> > > it is with your query.
> > >
> > > On Thu, Mar 1, 2018 at 2:24 PM Abhi Basu <90...@gmail.com> wrote:
> > >
> > > >  Can someone please help me?
> > > >
> > > > Schema.xml
> > > >
> > > > <field name="PropertyAddressState" type="string" indexed="true"
> > > > stored="true" docValues="true"/>
> > > >
> > > > <field name="text" type="text_general" indexed="true" stored="false"
> > > > multiValued="true"/>
> > > >
> > > >
> > > > <copyfield source="PropertyAddressState" dest="text"/>
> > > >
> > > >
> > > > <fieldType name="text_general" class="solr.TextField"
> > > > positionIncrementGap="100">
> > > >   <analyzer type="index">
> > > >     <tokenizer class="solr.StandardTokenizerFactory"/>
> > > >     <filter class="solr.StopFilterFactory" ignoreCase="true"
> > > > words="stopwords.txt" />
> > > >     <filter class="solr.SynonymFilterFactory"
> synonyms="synonyms.txt"
> > > > ignoreCase="true" expand="true"
> > > > tokenizerFactory="solr.StandardTokenizerFactory"/>
> > > >     <filter class="solr.LowerCaseFilterFactory"/>
> > > >   </analyzer>
> > > >   <analyzer type="query">
> > > >     <tokenizer class="solr.StandardTokenizerFactory"/>
> > > >     <filter class="solr.StopFilterFactory" ignoreCase="true"
> > > > words="stopwords.txt" />
> > > >     <!--filter class="solr.SynonymFilterFactory"
> > > > synonyms="synonyms.txt" ignoreCase="true" expand="true"/-->
> > > >     <filter class="solr.LowerCaseFilterFactory"/>
> > > >   </analyzer>
> > > > </fieldType>
> > > >
> > > >
> > > >
> > > >
> > > > Synonyms.txt has been populated with State abbreviations and names.
> > > >
> > > >
> > > > When searching for
> > > >
> > > > PropertyAddressState:"Oregon", I do not find docs with "OR".
> > > >
> > > >
> > > >
> > > > What am I missing?
> > > >
> > > >
> > > > Thanks,
> > > >
> > > > Abhi
> > > >
> > >
> >
> >
> >
> > --
> > Abhi Basu
> >
>



-- 
Abhi Basu

Re: Synonym not working in 4.10 / CDH 5.14

Posted by Alessandro Hoss <al...@gmail.com>.
How's your synonyms declared in the file?

That xml comment (<!-- -->) in the synonym filter section isn't there in
your running solr schema.xml, right? :)

On Thu, Mar 1, 2018 at 2:53 PM Abhi Basu <90...@gmail.com> wrote:

> Yes have tested with PA and NY, nothing works.
>
> On Thu, Mar 1, 2018 at 11:38 AM, Alessandro Hoss <al...@gmail.com>
> wrote:
>
> > Have you tested with another state?
> >
> > I'm asking because maybe solr is considering "OR" as a clause separator
> > instead of a search term, and in this case the problem is not with
> synonym,
> > it is with your query.
> >
> > On Thu, Mar 1, 2018 at 2:24 PM Abhi Basu <90...@gmail.com> wrote:
> >
> > >  Can someone please help me?
> > >
> > > Schema.xml
> > >
> > > <field name="PropertyAddressState" type="string" indexed="true"
> > > stored="true" docValues="true"/>
> > >
> > > <field name="text" type="text_general" indexed="true" stored="false"
> > > multiValued="true"/>
> > >
> > >
> > > <copyfield source="PropertyAddressState" dest="text"/>
> > >
> > >
> > > <fieldType name="text_general" class="solr.TextField"
> > > positionIncrementGap="100">
> > >   <analyzer type="index">
> > >     <tokenizer class="solr.StandardTokenizerFactory"/>
> > >     <filter class="solr.StopFilterFactory" ignoreCase="true"
> > > words="stopwords.txt" />
> > >     <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
> > > ignoreCase="true" expand="true"
> > > tokenizerFactory="solr.StandardTokenizerFactory"/>
> > >     <filter class="solr.LowerCaseFilterFactory"/>
> > >   </analyzer>
> > >   <analyzer type="query">
> > >     <tokenizer class="solr.StandardTokenizerFactory"/>
> > >     <filter class="solr.StopFilterFactory" ignoreCase="true"
> > > words="stopwords.txt" />
> > >     <!--filter class="solr.SynonymFilterFactory"
> > > synonyms="synonyms.txt" ignoreCase="true" expand="true"/-->
> > >     <filter class="solr.LowerCaseFilterFactory"/>
> > >   </analyzer>
> > > </fieldType>
> > >
> > >
> > >
> > >
> > > Synonyms.txt has been populated with State abbreviations and names.
> > >
> > >
> > > When searching for
> > >
> > > PropertyAddressState:"Oregon", I do not find docs with "OR".
> > >
> > >
> > >
> > > What am I missing?
> > >
> > >
> > > Thanks,
> > >
> > > Abhi
> > >
> >
>
>
>
> --
> Abhi Basu
>

Re: Synonym not working in 4.10 / CDH 5.14

Posted by Abhi Basu <90...@gmail.com>.
Yes have tested with PA and NY, nothing works.

On Thu, Mar 1, 2018 at 11:38 AM, Alessandro Hoss <al...@gmail.com> wrote:

> Have you tested with another state?
>
> I'm asking because maybe solr is considering "OR" as a clause separator
> instead of a search term, and in this case the problem is not with synonym,
> it is with your query.
>
> On Thu, Mar 1, 2018 at 2:24 PM Abhi Basu <90...@gmail.com> wrote:
>
> >  Can someone please help me?
> >
> > Schema.xml
> >
> > <field name="PropertyAddressState" type="string" indexed="true"
> > stored="true" docValues="true"/>
> >
> > <field name="text" type="text_general" indexed="true" stored="false"
> > multiValued="true"/>
> >
> >
> > <copyfield source="PropertyAddressState" dest="text"/>
> >
> >
> > <fieldType name="text_general" class="solr.TextField"
> > positionIncrementGap="100">
> >   <analyzer type="index">
> >     <tokenizer class="solr.StandardTokenizerFactory"/>
> >     <filter class="solr.StopFilterFactory" ignoreCase="true"
> > words="stopwords.txt" />
> >     <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
> > ignoreCase="true" expand="true"
> > tokenizerFactory="solr.StandardTokenizerFactory"/>
> >     <filter class="solr.LowerCaseFilterFactory"/>
> >   </analyzer>
> >   <analyzer type="query">
> >     <tokenizer class="solr.StandardTokenizerFactory"/>
> >     <filter class="solr.StopFilterFactory" ignoreCase="true"
> > words="stopwords.txt" />
> >     <!--filter class="solr.SynonymFilterFactory"
> > synonyms="synonyms.txt" ignoreCase="true" expand="true"/-->
> >     <filter class="solr.LowerCaseFilterFactory"/>
> >   </analyzer>
> > </fieldType>
> >
> >
> >
> >
> > Synonyms.txt has been populated with State abbreviations and names.
> >
> >
> > When searching for
> >
> > PropertyAddressState:"Oregon", I do not find docs with "OR".
> >
> >
> >
> > What am I missing?
> >
> >
> > Thanks,
> >
> > Abhi
> >
>



-- 
Abhi Basu

Re: Synonym not working in 4.10 / CDH 5.14

Posted by Alessandro Hoss <al...@gmail.com>.
Have you tested with another state?

I'm asking because maybe solr is considering "OR" as a clause separator
instead of a search term, and in this case the problem is not with synonym,
it is with your query.

On Thu, Mar 1, 2018 at 2:24 PM Abhi Basu <90...@gmail.com> wrote:

>  Can someone please help me?
>
> Schema.xml
>
> <field name="PropertyAddressState" type="string" indexed="true"
> stored="true" docValues="true"/>
>
> <field name="text" type="text_general" indexed="true" stored="false"
> multiValued="true"/>
>
>
> <copyfield source="PropertyAddressState" dest="text"/>
>
>
> <fieldType name="text_general" class="solr.TextField"
> positionIncrementGap="100">
>   <analyzer type="index">
>     <tokenizer class="solr.StandardTokenizerFactory"/>
>     <filter class="solr.StopFilterFactory" ignoreCase="true"
> words="stopwords.txt" />
>     <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
> ignoreCase="true" expand="true"
> tokenizerFactory="solr.StandardTokenizerFactory"/>
>     <filter class="solr.LowerCaseFilterFactory"/>
>   </analyzer>
>   <analyzer type="query">
>     <tokenizer class="solr.StandardTokenizerFactory"/>
>     <filter class="solr.StopFilterFactory" ignoreCase="true"
> words="stopwords.txt" />
>     <!--filter class="solr.SynonymFilterFactory"
> synonyms="synonyms.txt" ignoreCase="true" expand="true"/-->
>     <filter class="solr.LowerCaseFilterFactory"/>
>   </analyzer>
> </fieldType>
>
>
>
>
> Synonyms.txt has been populated with State abbreviations and names.
>
>
> When searching for
>
> PropertyAddressState:"Oregon", I do not find docs with "OR".
>
>
>
> What am I missing?
>
>
> Thanks,
>
> Abhi
>