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 Anil <an...@gmail.com> on 2016/08/26 13:14:27 UTC

Regex search on Solr

HI,

I am indexing a text abc*17-logs.tgz/var/log/analyticsd *in solr and
indexed term after all filters is *abc**17-logs.tgz/var/log/analyticsd*

what is the regex to search abc17-logs.tgz/var/log/analyticsd  in solr ?
Following is the query and index analyzers

I tried abc[0-9]+-logs\.tgz/var\/log\/analyticsd and its not working.
Please advice.

<analyzer type="query"> <charFilter class=
"solr.PatternReplaceCharFilterFactory" pattern="([a-zA-Z])\1+" replacement=
"$1$1"/> <tokenizer class="solr.WhitespaceTokenizerFactory"/> <filter class=
"solr.WordDelimiterFilterFactory" splitOnCaseChange="0" splitOnNumerics="0"
stemEnglishPossessive="1" preserveOriginal="0" generateWordParts="1"
catenateWords="1" generateNumberParts="0" catenateNumbers="0" catenateAll=
"0" types="wdfftypes.txt"/> <filter class="solr.LowerCaseFilterFactory"/> <
filter class="solr.ASCIIFoldingFilterFactory"/> <filter class=
"solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_en.txt" />
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase
="true" expand="true"/> </analyzer>

<analyzer type="index"> <charFilter class=
"solr.PatternReplaceCharFilterFactory" pattern="([a-zA-Z])\1+" replacement=
"$1$1"/> <tokenizer class="solr.WhitespaceTokenizerFactory"/> <filter class=
"solr.WordDelimiterFilterFactory" generateWordParts="1" splitOnCaseChange=
"0" splitOnNumerics="0" stemEnglishPossessive="1" preserveOriginal="0"
catenateWords="1" generateNumberParts="0" catenateNumbers="0" catenateAll=
"0" types="wdfftypes.txt"/> <filter class="solr.StopFilterFactory"
ignoreCase="true" words="lang/stopwords_en.txt" /> <filter class=
"solr.LowerCaseFilterFactory"/> <filter class=
"solr.ASCIIFoldingFilterFactory"/> <filter class=
"solr.ReversedWildcardFilterFactory"/> </analyzer>

Thanks