Maybe a custom search component that runs before the QueryComponent and does the escaping?

-- Jack Krupansky

-----Original Message----- From: Dirk Högemann
Sent: Tuesday, October 30, 2012 1:07 PM
To: solr-user@lucene.apache.org
Subject: Forwardslash delimiter.Solr4.0 query for path like /Customer/Content/*

Hi,

I am currently upgrading from Solr 3.5 to Solr 4.0

I used to have filter-bases restrictions for my search based on the paths
of documents in a content repository.
E.g.  fq={!q.op=OR df=}folderPath_}/customer/content/*

Unfortunately this does not work anymore, as lucene now supports
Regexpsearches - delimiting the expression with forward slashes:
http://lucene.apache.org/core/4_0_0-BETA/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#Regexp_Searches

this leads to a parsed query, which is of course not what is intended:

<arr
name="parsed_filter_queries"><str>RegexpQuery(folderPath_:/standardlsg/)
folderPath_:shareddocs RegexpQuery(folderPath_:/personen/)
folderPath_:*</str></arr>

Is there a possibility to make the example query above work, without
escaping the "/" with "\/"?
Otherwise I will have to parse all queries  (coming from persisted
configurations in the repositiory) and escape the relevant parts of the
queries on that field, which is somewhat ugly...

The field I search on is of type:

<analyzer type="index">
       <tokenizer class="solr.KeywordTokenizerFactory"/>
       <filter class="solr.LowerCaseFilterFactory"/>
     </analyzer>
     <analyzer type="search">
       <tokenizer class="solr.KeywordTokenizerFactory"/>
       <filter class="solr.LowerCaseFilterFactory"/>
</analyzer>

Best and thanks for any hints
Dirk

Reply via email to