Hi,

What's your default query field in solrconfig.xml?

<requestHandler name="/select" class="solr.SearchHandler">
<str name="df">[WHAT IS IN HERE?]</str>

I think what's happening is that the query:

(descricaoRoteiro: BPS 8D BEACH*)

gets interpreted as:

descricaoRoteiro:BPS (8D BEACH*)

then on the (8D BEACH*) a default field name is applied.

You can use debugQuery parameter to see how the query was parsed.

HTH,
Dmitry


On Mon, Sep 2, 2013 at 2:53 PM, Sergio Stateri <stat...@gmail.com> wrote:

> hi,
>
> How can I looking for an exact phrase in query.setQuery method (SolrJ)?
>
> Like this:
>
> SolrQuery query = new SolrQuery();
> query.setQuery( "(descricaoRoteiro: BPS 8D BEACH*)" );
> query.set("start", "200");
> query.set("rows", "10");
> query.addField("descricaoRoteiro");
> QueryResponse rsp = server.query( query );
>
>
> When I run this code, the following exception is thrown:
>
> Exception in thread "main"
> org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: no
> field name specified in query and no default specified via 'df' param
> at
>
> org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:424)
> at
>
> org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:180)
> at
>
> org.apache.solr.client.solrj.request.QueryRequest.process(QueryRequest.java:90)
> at org.apache.solr.client.solrj.SolrServer.query(SolrServer.java:301)
> at
>
> com.teste.SearchRoteirosFromCollection.extrairEApresentarResultados(SearchRoteirosFromCollection.java:65)
> ...
>
>
> But If I search one a word od put * between two words, the search works
> fine.
>
>
> Thanks in advance,
>
>
> --
> Sergio Stateri Jr.
> stat...@gmail.com
>

Reply via email to