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 Ramzi Alqrainy <ra...@gmail.com> on 2014/10/22 06:21:30 UTC

Re: Suggester on Dynamic fields

Use query() to have Solr search for results. You have to pass a SolrQuery
object that describes the query, and you will get back a QueryResponse (from
the org.apache.solr.client.solrj.response package).
SolrQuery has methods that make it easy to add parameters to choose a
request handler and send parameters to it. Here is a very simple example
that uses the default request handler and sets the q parameter:

<http://lucene.472066.n3.nabble.com/file/n4165288/1.png> 

To choose a different request handler, for example, just set the qt
parameter like this:

<http://lucene.472066.n3.nabble.com/file/n4165288/2.png> 

Once you have your SolrQuery set up, submit it with query():

<http://lucene.472066.n3.nabble.com/file/n4165288/3.png> 

The client makes a network connection and sends the query. Solr processes
the query, and the response is sent and parsed into a QueryResponse.

The QueryResponse is a collection of documents that satisfy the query
parameters. You can retrieve the documents directly with getResults() and
you can call other methods to find out information about highlighting or
facets.

<http://lucene.472066.n3.nabble.com/file/n4165288/4.png> 



--
View this message in context: http://lucene.472066.n3.nabble.com/Suggester-on-Dynamic-fields-tp4165270p4165288.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Suggester on Dynamic fields

Posted by Simon <si...@gallerysystems.com>.
Hi Ramzi,

First thanks for your comments.

Regarding your line
     parameters.set("qt", /suggest")

My understanding is that "suggest" has to be a handler defined in
SolrConfig.xml. And the handler needs to have one of more defined (search)
component(s).  The search component syntax needs dictionary (or file) or a
indexed field to search on.   In my case, I am going with the indexed
fields.  

As I stated in my post, the issue I have is that I have a list of fields
that user configured at run time (which are defined as dynamic fields).
Whenever user configured a field to be used for autosuggestion, it will
trigger indexing.  Later on, when user search in the configured field, he
expects the auto completion feature while he types.  Since the fields are
configured at run time, I can not defined Search components for those fields
in advance unless the Search component syntax support dynamic fields,
something like f_*_auto. But unfortunately I didn't see anything like that. 

My first question is how to make dynamic field works in SearchComponent
definitions.  If this is impossible, the second question  would be how to
create the handler on the fly when user configure a field to be auto
completion. 

Thanks,
Simon



--
View this message in context: http://lucene.472066.n3.nabble.com/Suggester-on-Dynamic-fields-tp4165270p4165329.html
Sent from the Solr - User mailing list archive at Nabble.com.