Feature Request: Multiple default search fields

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Feature Request: Multiple default search fields

Jack L

The default search field is really handy. It helps simplify
the query, and thus simplify the application using solr.
My understand is that solr only allows one default search field.
It would be useful to allow multiple default fields, and maybe
also specify a global field boost in the schema file, as opposed
to on a per document bases during post time. For example, article
title can be given a higher boost factor than article content.

--
Best regards,
Jack

Reply | Threaded
Open this post in threaded view
|

Re: Feature Request: Multiple default search fields

Brian Whitman

On May 14, 2007, at 12:38 PM, Jack L wrote:
>
> The default search field is really handy. It helps simplify
> the query, and thus simplify the application using solr.
> My understand is that solr only allows one default search field.
> It would be useful to allow multiple default fields, and maybe
> also specify a global field boost in the schema file, as opposed
> to on a per document bases during post time. For example, article
> title can be given a higher boost factor than article content.


For your first issue, use a copyField to copy all the text you want  
as default to a default search field.
For the second, have you looked at http://wiki.apache.org/solr/ 
DisMaxRequestHandler ? You set up boosts per field in solrconfig.xml  
that way.




Reply | Threaded
Open this post in threaded view
|

Re[2]: Feature Request: Multiple default search fields

Jack L
Hello Brian,

Thanks for your answer. It was helpful.

> For your first issue, use a copyField to copy all the text you want
> as default to a default search field.

Oh, I didn't know I could copy multiple fields to one field :)
I didn't quite figure out what copyField was for anyway but I guess
this is a good usage.

The doc describes the purpose of copyField as:

"This is provided as a convenient way to ensure that data is
put into several fields, without needing to include the data in
the update command multiple times."

It sounds like many to many copying. What is the intended use case
for this?

> For the second, have you looked at http://wiki.apache.org/solr/ 
> DisMaxRequestHandler ? You set up boosts per field in solrconfig.xml
> that way.

This seems to be able to resolve both of my problems (multiple
default search fields and field boost.) If my understanding is
correct, it should be a more useful RequestHandler for probably
most solr uses. It is not the default though. Is it because it
requires some more configuration than the StandardRequestHander?
But I'll definitely give it a try.

Jack


Reply | Threaded
Open this post in threaded view
|

Re: Re[2]: Feature Request: Multiple default search fields

Yonik Seeley-2
On 5/16/07, Jack L <[hidden email]> wrote:
> The doc describes the purpose of copyField as:
>
> "This is provided as a convenient way to ensure that data is
> put into several fields, without needing to include the data in
> the update command multiple times."
>
> It sounds like many to many copying. What is the intended use case
> for this?

The example schema.xml is better at pointing out that there are two use cases:
  <!-- copyField commands copy one field to another at the time a document
        is added to the index.  It's used either to index the same
field differently,
        or to add multiple fields to the same field for easier/faster searching.
  -->

   <copyField source="id" dest="sku"/>

   <copyField source="cat" dest="text"/>
   <copyField source="name" dest="text"/>
   <copyField source="name" dest="nameSort"/>
   <copyField source="name" dest="alphaNameSort"/>
   <copyField source="manu" dest="text"/>
   <copyField source="features" dest="text"/>
   <copyField source="includes" dest="text"/>

   <copyField source="manu" dest="manu_exact"/>

> This seems to be able to resolve both of my problems (multiple
> default search fields and field boost.) If my understanding is
> correct, it should be a more useful RequestHandler for probably
> most solr uses.
> It is not the default though.

It came later... "standard" was the first request handler.
dismax is the recommended starting point for anyone dealing with user
entered queries:
http://wiki.apache.org/solr/SolrRelevancyFAQ
The documentation is slowly improving :-)

-Yonik
Reply | Threaded
Open this post in threaded view
|

Re[4]: Feature Request: Multiple default search fields

Jack L
Thanks Yonik.

If I want to try out DisMaxRequestHandler, do I need to repost?
I suppose it is for searching only and does not require re-indexing?

--
Best regards,
Jack

> It came later... "standard" was the first request handler.
> dismax is the recommended starting point for anyone dealing with user
> entered queries:
> http://wiki.apache.org/solr/SolrRelevancyFAQ
> The documentation is slowly improving :-)

> -Yonik

Reply | Threaded
Open this post in threaded view
|

Re: Re[4]: Feature Request: Multiple default search fields

Yonik Seeley-2
On 5/16/07, Jack L <[hidden email]> wrote:
> If I want to try out DisMaxRequestHandler, do I need to repost?
> I suppose it is for searching only and does not require re-indexing?

No need to re-index, it's just a different request handler.
It's very much like the standard request handler, but it uses it's own
query parser in conjunction with it's other parameters to construct
the "base" query.  faceting, filtering, highlighting, etc, are all the
same as the standard request handler.

Start by commenting out (or customizing) the defaults in the dismax
request handler in solrconfig.xml.  Then when you do a query, add
qt=dismax to the parameters.

-Yonik