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 Dario Rigolin <da...@comperio.it> on 2011/03/10 17:37:51 UTC

Re: Error on string searching # [STRANGE] [FIX]

On Thursday, March 10, 2011 04:58:43 pm Dario Rigolin wrote:

It seems fixed by setting into WordDelimiterTokenizer

catenateWords="0" catenateNumbers="0" 

Instead of "1" on both...

Nice to know...


> On Thursday, March 10, 2011 04:53:51 pm Juan Grande wrote:
> > I think that the problem is with the "#" symbol, because it has a special
> > meaning when used inside a URL. Try replacing it with "%23", like this:
> > http://192.168.3.3:8983/solr3.1/core0/select?q=myfield:("S.%23L.W.VI.37")
> 
> If I do urlencoding and changing in %23 I get this error
> 
> 
> 3
> 
> java.lang.ArrayIndexOutOfBoundsException: 3
> 	at
> org.apache.lucene.search.MultiPhraseQuery$MultiPhraseWeight.scorer(MultiPhr
> aseQuery.java:185) at
> org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:208) at
> org.apache.lucene.search.Searcher.search(Searcher.java:88)
> ....
> 
> > Regards,
> > *
> > Juan G. Grande*
> > -- Solr Consultant @ http://www.plugtree.com
> > -- Blog @ http://juanggrande.wordpress.com
> > 
> > 
> > On Thu, Mar 10, 2011 at 12:45 PM, Dario Rigolin
> > 
> > <da...@comperio.it>wrote:
> > > I have a text field indexed using WordDelimeter
> > > Indexed in that way
> > > <doc>
> > > <field name="myfield">S.#L.W.VI.37</field>
> > > ...
> > > </doc>
> > > 
> > > Serching in that way:
> > > http://192.168.3.3:8983/solr3.1/core0/select?q=myfield:("S.#L.W.VI.37")
> > > 
> > > Makes this error:
> > > 
> > > org.apache.lucene.queryParser.ParseException: Cannot parse
> > > 'myfield:("S.': Lexical error at line 1, column 17.  Encountered: <EOF>
> > > after : "\"S."
> > > 
> > > It seems that # is a wrong character for query... I try urlencoding o
> > > adding a
> > > slash before or removing quotes but other errors comes:
> > > 
> > > http://192.168.3.3:8983/solr3.1/core0/select?q=myfield:(S.#L.W.VI.37)
> > > 
> > > org.apache.lucene.queryParser.ParseException: Cannot parse
> > > 'myfield:(S.': Encountered "<EOF>" at line 1, column 15.
> > > 
> > > Was expecting one of:
> > >    <AND> ...
> > >    <OR> ...
> > >    <NOT> ...
> > >    "+" ...
> > >    "-" ...
> > >    "(" ...
> > >    ")" ...
> > >    "*" ...
> > >    "^" ...
> > >    <QUOTED> ...
> > >    <TERM> ...
> > >    <FUZZY_SLOP> ...
> > >    <PREFIXTERM> ...
> > >    <WILDTERM> ...
> > >    "[" ...
> > >    "{" ...
> > >    <NUMBER> ...
> > > 
> > > Any idea how to solve this?
> > > Maybe a bug? Or probably I'm missing something.
> > > 
> > > Dario.