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 Jay Potharaju <js...@gmail.com> on 2019/01/14 07:46:18 UTC

copyfield not working

Hi,
I have a copy field in which i am copying the contents of text_en field to
another custom field.
After indexing i was expecting any of the special characters in the
paragraph to be removed, but it does not look like that is happening. The
copied content is same as the what is there in the source. I ran analysis
...looks like the pattern matching works as expected and the special
characters are removed.

Any suggestions?
<fieldType name="text_no_specialchars" class="solr.TextField"> <analyzer> <
charFilter class="solr.PatternReplaceCharFilterFactory" pattern=
"['!#\$%'\(\)\*+,-\./:;=?@\[\]\^_`{|}~!@#$%^*]" /> <tokenizer class=
"solr.StandardTokenizerFactory"/> <filter class=
"solr.SuggestStopFilterFactory" ignoreCase="true" words=
"lang/stopwords_en.txt" /> <filter class="solr.LowerCaseFilterFactory"/> <
filter class="solr.EnglishPossessiveFilterFactory"/> <filter class=
"solr.KeywordMarkerFilterFactory" protected="protwords.txt"/> </analyzer> </
fieldType>

Thanks
Jay

Re: copyfield not working

Posted by Jay Potharaju <js...@gmail.com>.
copyfield syntax from my schema file...
<copyField source="field" dest="field_plain"/>
Thanks
Jay



On Sun, Jan 13, 2019 at 11:46 PM Jay Potharaju <js...@gmail.com>
wrote:

> Hi,
> I have a copy field in which i am copying the contents of text_en field to
> another custom field.
> After indexing i was expecting any of the special characters in the
> paragraph to be removed, but it does not look like that is happening. The
> copied content is same as the what is there in the source. I ran analysis
> ...looks like the pattern matching works as expected and the special
> characters are removed.
>
> Any suggestions?
> <fieldType name="text_no_specialchars" class="solr.TextField"> <analyzer>
> <charFilter class="solr.PatternReplaceCharFilterFactory" pattern=
> "['!#\$%'\(\)\*+,-\./:;=?@\[\]\^_`{|}~!@#$%^*]" /> <tokenizer class=
> "solr.StandardTokenizerFactory"/> <filter class=
> "solr.SuggestStopFilterFactory" ignoreCase="true" words=
> "lang/stopwords_en.txt" /> <filter class="solr.LowerCaseFilterFactory"/> <
> filter class="solr.EnglishPossessiveFilterFactory"/> <filter class=
> "solr.KeywordMarkerFilterFactory" protected="protwords.txt"/> </analyzer>
> </fieldType>
>
> Thanks
> Jay
>
>

Re: copyfield not working

Posted by Jay Potharaju <js...@gmail.com>.
 thanks for the info Andrea!
Thanks
Jay



On Sun, Jan 13, 2019 at 11:53 PM Andrea Gazzarini <a....@sease.io>
wrote:

> Hi Jay, the text analysis always operates on the indexed content. The
> stored content of a filed is left untouched unless you do something
> before it gets indexed (e.g. on client side or by an
> UpdateRequestProcessor).
>
> Cheers,
> Andrea
>
> On 14/01/2019 08:46, Jay Potharaju wrote:
> > Hi,
> > I have a copy field in which i am copying the contents of text_en field
> to
> > another custom field.
> > After indexing i was expecting any of the special characters in the
> > paragraph to be removed, but it does not look like that is happening. The
> > copied content is same as the what is there in the source. I ran analysis
> > ...looks like the pattern matching works as expected and the special
> > characters are removed.
> >
> > Any suggestions?
> > <fieldType name="text_no_specialchars" class="solr.TextField">
> <analyzer> <
> > charFilter class="solr.PatternReplaceCharFilterFactory" pattern=
> > "['!#\$%'\(\)\*+,-\./:;=?@\[\]\^_`{|}~!@#$%^*]" /> <tokenizer class=
> > "solr.StandardTokenizerFactory"/> <filter class=
> > "solr.SuggestStopFilterFactory" ignoreCase="true" words=
> > "lang/stopwords_en.txt" /> <filter class="solr.LowerCaseFilterFactory"/>
> <
> > filter class="solr.EnglishPossessiveFilterFactory"/> <filter class=
> > "solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
> </analyzer> </
> > fieldType>
> >
> > Thanks
> > Jay
> >
>

Re: copyfield not working

Posted by Andrea Gazzarini <a....@sease.io>.
Hi Jay, the text analysis always operates on the indexed content. The 
stored content of a filed is left untouched unless you do something 
before it gets indexed (e.g. on client side or by an 
UpdateRequestProcessor).

Cheers,
Andrea

On 14/01/2019 08:46, Jay Potharaju wrote:
> Hi,
> I have a copy field in which i am copying the contents of text_en field to
> another custom field.
> After indexing i was expecting any of the special characters in the
> paragraph to be removed, but it does not look like that is happening. The
> copied content is same as the what is there in the source. I ran analysis
> ...looks like the pattern matching works as expected and the special
> characters are removed.
>
> Any suggestions?
> <fieldType name="text_no_specialchars" class="solr.TextField"> <analyzer> <
> charFilter class="solr.PatternReplaceCharFilterFactory" pattern=
> "['!#\$%'\(\)\*+,-\./:;=?@\[\]\^_`{|}~!@#$%^*]" /> <tokenizer class=
> "solr.StandardTokenizerFactory"/> <filter class=
> "solr.SuggestStopFilterFactory" ignoreCase="true" words=
> "lang/stopwords_en.txt" /> <filter class="solr.LowerCaseFilterFactory"/> <
> filter class="solr.EnglishPossessiveFilterFactory"/> <filter class=
> "solr.KeywordMarkerFilterFactory" protected="protwords.txt"/> </analyzer> </
> fieldType>
>
> Thanks
> Jay
>