if you are using the standard request handler, ":" is a keyword... so you are looking for a field called "http" with value "//www.webspawner.com/users/smartbus/ "

either switch to the 'dismax' query parser, or escape the string before sending it to solr:

query.setQuery( ClientUtils.escapeQueryChars( queryString ) )



On Oct 30, 2008, at 3:59 PM, Jose Garcia wrote:

Hi,

I use solrj for my application and have one problem with the SolrQuery. I create my own query but it don't work. I want to search urls in my text indexed. How can I avoid ":" in my query? Exists any method in the Solrj
API for this?

Best Regards

QueryString = "http://www.webspawner.com/users/smartbus/";
SolrQuery query = new SolrQuery();
       query.setQuery(queryString);

Error:
Caused by: org.apache.solr.common.SolrException:
org.apache.lucene.queryParser.ParseException: Cannot parse 'html:
http://www.webspawner.com/smartbus/user': Encountered ":" at line 1, column 9. Was expecting one of: <EOF> <AND> ... <OR> ... <NOT> ... " " ... "-" ... "(" ... "*" ... "^" ... <QUOTED> ... <TERM> ... <FUZZY_SLOP> ... <PREFIXTERM> ... <WILDTERM>
...     "[" ...     "{" ...     <NUMBER> ...
    [java] org.apache.lucene.queryParser.ParseException: Cannot parse
'html:http://www.webspawner.com/smartbus/user': Encountered ":" at line 1,
column 9. Was expecting one of:     <EOF>      <AND> ...     <OR> ...
<NOT> ...     " " ...     "-" ...     "(" ...     "*" ...     "^" ...
<QUOTED> ...     <TERM> ...     <FUZZY_SLOP> ...     <PREFIXTERM> ...
<WILDTERM> ...     "[" ...     "{" ...     <NUMBER> ...
    [java] request:
http://localhost:8081/apache-solr-1.3-dev/select?q=html:http://www.webspawner.com/smartbus/user&wt=javabin&version=2.2
    [java]     at
org .apache .solr .client .solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java: 343)
    [java]     at
org .apache .solr .client .solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java: 183)
    [java]     at
org .apache .solr.client.solrj.request.QueryRequest.process(QueryRequest.java:90)
    [java]     ... 3 more

Reply via email to