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 Bilgin Ibryam <bi...@gmail.com> on 2010/07/20 10:34:19 UTC

Beginner question

Hi all,

I have two simple questions:

I have an Item entity with id, name, category and description fields. The
main requirements is to be able to search in all the fields with the same
string and different priority per field, so matches in name appear before
category matches, and they appear before description field matches in the
result list.

1. I think to create an index having the same fields, because each field
needs different priority during searching.

2. And then do the search with a query like this:
name:search_string^1.3 OR categpry:search_string^1.2 OR
description:search_string^1.1

Is this the right approach to model the index and search query?

Thanks in advance.
Bilgin

Re: Beginner question

Posted by Ahmet Arslan <io...@yahoo.com>.
> Is it possible to use dismax query parser using solrJ,
> since this is how I'm going to access solr?

Sure it is possible. SolrQuery.setQueryType("dismax") is equals to &defType=dismax.

More permanent way: You can define your dismax parameters (fields and boost weights) in solrconfig.xml, and make default="true" for that SearchHandler. Example solrconfig.xml contains examples of dismax setups with different parameters/settings.


      

Re: Beginner question

Posted by Erik Hatcher <er...@gmail.com>.
On Jul 20, 2010, at 6:14 AM, Bilgin Ibryam wrote:
> So I assume that storing entity each field in as a separate index  
> field is
> correct, since they will get different scoring.

Just to get the terminology right... to use dismax, *index* each field  
separately.  Whether a field is *stored* or not is an unrelated concern.

> Is it possible to use dismax query parser using solrJ, since this is  
> how I'm
> going to access solr?

Yes, all of Solr's HTTP capabilities are available through SolrJ.

	Erik


Re: Beginner question

Posted by Bilgin Ibryam <bi...@gmail.com>.
Thanks for the answers guys.

So I assume that storing entity each field in as a separate index field is
correct, since they will get different scoring.

Is it possible to use dismax query parser using solrJ, since this is how I'm
going to access solr?



On Tue, Jul 20, 2010 at 10:46 AM, MitchK <mi...@web.de> wrote:

>
> Here you can find params and their meanings for the dismax-handler.
> You may not find anything in the wiki by searching for a parser ;).
>
> Link:  http://wiki.apache.org/solr/DisMaxRequestHandler Wiki:
> DisMaxRequestHandler
>
> Kind regards
> - Mitch
>
>
>
> Erik Hatcher-4 wrote:
> >
> > Consider using the dismax query parser instead.  It has more
> > sophisticated capability to spread user queries across multiple fields
> > with different weightings.
> >
> >       Erik
> >
> > On Jul 20, 2010, at 4:34 AM, Bilgin Ibryam wrote:
> >
> >> Hi all,
> >>
> >> I have two simple questions:
> >>
> >> I have an Item entity with id, name, category and description
> >> fields. The
> >> main requirements is to be able to search in all the fields with the
> >> same
> >> string and different priority per field, so matches in name appear
> >> before
> >> category matches, and they appear before description field matches
> >> in the
> >> result list.
> >>
> >> 1. I think to create an index having the same fields, because each
> >> field
> >> needs different priority during searching.
> >>
> >> 2. And then do the search with a query like this:
> >> name:search_string^1.3 OR categpry:search_string^1.2 OR
> >> description:search_string^1.1
> >>
> >> Is this the right approach to model the index and search query?
> >>
> >> Thanks in advance.
> >> Bilgin
> >
> >
> >
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Beginner-question-tp980695p980819.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: Beginner question

Posted by MitchK <mi...@web.de>.
Here you can find params and their meanings for the dismax-handler.
You may not find anything in the wiki by searching for a parser ;).

Link:  http://wiki.apache.org/solr/DisMaxRequestHandler Wiki:
DisMaxRequestHandler 

Kind regards
- Mitch



Erik Hatcher-4 wrote:
> 
> Consider using the dismax query parser instead.  It has more  
> sophisticated capability to spread user queries across multiple fields  
> with different weightings.
> 
> 	Erik
> 
> On Jul 20, 2010, at 4:34 AM, Bilgin Ibryam wrote:
> 
>> Hi all,
>>
>> I have two simple questions:
>>
>> I have an Item entity with id, name, category and description  
>> fields. The
>> main requirements is to be able to search in all the fields with the  
>> same
>> string and different priority per field, so matches in name appear  
>> before
>> category matches, and they appear before description field matches  
>> in the
>> result list.
>>
>> 1. I think to create an index having the same fields, because each  
>> field
>> needs different priority during searching.
>>
>> 2. And then do the search with a query like this:
>> name:search_string^1.3 OR categpry:search_string^1.2 OR
>> description:search_string^1.1
>>
>> Is this the right approach to model the index and search query?
>>
>> Thanks in advance.
>> Bilgin
> 
> 
> 
-- 
View this message in context: http://lucene.472066.n3.nabble.com/Beginner-question-tp980695p980819.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Beginner question

Posted by Erik Hatcher <er...@gmail.com>.
Consider using the dismax query parser instead.  It has more  
sophisticated capability to spread user queries across multiple fields  
with different weightings.

	Erik

On Jul 20, 2010, at 4:34 AM, Bilgin Ibryam wrote:

> Hi all,
>
> I have two simple questions:
>
> I have an Item entity with id, name, category and description  
> fields. The
> main requirements is to be able to search in all the fields with the  
> same
> string and different priority per field, so matches in name appear  
> before
> category matches, and they appear before description field matches  
> in the
> result list.
>
> 1. I think to create an index having the same fields, because each  
> field
> needs different priority during searching.
>
> 2. And then do the search with a query like this:
> name:search_string^1.3 OR categpry:search_string^1.2 OR
> description:search_string^1.1
>
> Is this the right approach to model the index and search query?
>
> Thanks in advance.
> Bilgin