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 Jörg Agatz <jo...@googlemail.com> on 2009/07/15 08:29:50 UTC

DefaultSearchField ? "important"

Hallo Users...
And good Morning, in germany it is morning :-)

I have a realy important Prroblem...

My Fields are realy Bad.. Like
"CUPS_EBENE1_EBENE2_TASKS_CATEGORIE"

I have no Content field ore somthing like this...
So when i will search somthing, i need to search in ALL fields, but when i
search "*:test" it dosent Work,
And when i put "*" in the defaultSearchField" it dosent Work too

How i can Search in ALL fields?

Re: DefaultSearchField ? "important"

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Jörg,

You can use copyField to copy all fields into a single fields that has all other fields' content.
Then you can put that "catch all" field as the default search field.


Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch



----- Original Message ----
> From: Jörg Agatz <jo...@googlemail.com>
> To: solr-user@lucene.apache.org
> Sent: Wednesday, July 15, 2009 2:29:50 AM
> Subject: DefaultSearchField ? "important"
> 
> Hallo Users...
> And good Morning, in germany it is morning :-)
> 
> I have a realy important Prroblem...
> 
> My Fields are realy Bad.. Like
> "CUPS_EBENE1_EBENE2_TASKS_CATEGORIE"
> 
> I have no Content field ore somthing like this...
> So when i will search somthing, i need to search in ALL fields, but when i
> search "*:test" it dosent Work,
> And when i put "*" in the defaultSearchField" it dosent Work too
> 
> How i can Search in ALL fields?


Re: DefaultSearchField ? "important"

Posted by Mani Kumar <ma...@gmail.com>.
On Thu, Jul 16, 2009 at 12:33 AM, Erik Hatcher
<er...@ehatchersolutions.com>wrote:

>
> On Jul 15, 2009, at 2:59 PM, Mani Kumar wrote:
>
>> @mark, @otis:
>>
>
> Can I answer too?  :)
>
your welcome :)  ... thanks

>
>
>  yeah copying all the fields to one text field will work but what if i want
>> to assign specific weightage to specific fields?
>>
>> e.g. i have a three fields
>>
>> 1) title
>> 2) tags
>> 3) description
>>
>> i copied all of them to a new field called "all_text".
>>
>> now i want to search in all the fields with weightage assigned to title^4,
>> tags^2, description^1
>>
>> how it'll work then?
>>
>
> What you want, then, is the dismax query parser.
>  &defType=dismax&qf=title^5.0 tags^2.0 description^1.0 kinda thing.  It
> spreads query terms across multiple fields with field weights individually
> controllable.


- yes i am aware of dismax query parser ... but was just wondering it can be
done using single text field...

but my other question is still unanswered:

 how weightage is considered ?

is it a multiplication to scores of terms in fields ...
ex. terms in title * 4, terms in tags * 2

lets say i wanted to give twice importance to terms in title than tags. so
then shall i use title^2 tags^1    ?? or something else?



>
>        Erik
>
> thanks!mani

Re: DefaultSearchField ? "important"

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jul 15, 2009, at 2:59 PM, Mani Kumar wrote:
> @mark, @otis:

Can I answer too?  :)

> yeah copying all the fields to one text field will work but what if  
> i want
> to assign specific weightage to specific fields?
>
> e.g. i have a three fields
>
> 1) title
> 2) tags
> 3) description
>
> i copied all of them to a new field called "all_text".
>
> now i want to search in all the fields with weightage assigned to  
> title^4,
> tags^2, description^1
>
> how it'll work then?

What you want, then, is the dismax query parser.   
&defType=dismax&qf=title^5.0 tags^2.0 description^1.0 kinda thing.  It  
spreads query terms across multiple fields with field weights  
individually controllable.

	Erik


Re: DefaultSearchField ? "important"

Posted by Mani Kumar <ma...@gmail.com>.
@mark, @otis:
yeah copying all the fields to one text field will work but what if i want
to assign specific weightage to specific fields?

e.g. i have a three fields

1) title
2) tags
3) description

i copied all of them to a new field called "all_text".

now i want to search in all the fields with weightage assigned to title^4,
tags^2, description^1

how it'll work then?

another question: how weightage is considered ?

is it a multiplication to scores of terms in fields ...

ex. terms in title * 4, terms in tags * 2


thanks!
mani


On Wed, Jul 15, 2009 at 5:33 PM, Mark Miller <ma...@gmail.com> wrote:

> Jörg Agatz wrote:
>
>> Hallo Users...
>> And good Morning, in germany it is morning :-)
>>
>> I have a realy important Prroblem...
>>
>> My Fields are realy Bad.. Like
>> "CUPS_EBENE1_EBENE2_TASKS_CATEGORIE"
>>
>> I have no Content field ore somthing like this...
>> So when i will search somthing, i need to search in ALL fields, but when i
>> search "*:test" it dosent Work,
>> And when i put "*" in the defaultSearchField" it dosent Work too
>>
>> How i can Search in ALL fields?
>>
>>
>>
> Good morning! Its morning in Connecticut USA now ;)
>
> Check out: http://wiki.apache.org/solr/DisMaxRequestHandler
>
> You can specify multiple fields with the qf param.
>
> Also see CopyFields:
> http://wiki.apache.org/solr/SchemaXml#head-586f22933e9952e9130029e14aaf0b9718b917c4
>
> CopyFields let you copy the value from multiple fields to a single field
> during indexing. It doesn't show it at that spot on the wiki (it prob
> should), but you can use * in the names, eg
>
> <copyField source="*" dest="all_fields"/>
>
> Looks at the example schema for more examples.
>
>
> --
> - Mark
>
> http://www.lucidimagination.com
>
>
>
>

Re: DefaultSearchField ? "important"

Posted by Mark Miller <ma...@gmail.com>.
Jörg Agatz wrote:
> Hallo Users...
> And good Morning, in germany it is morning :-)
>
> I have a realy important Prroblem...
>
> My Fields are realy Bad.. Like
> "CUPS_EBENE1_EBENE2_TASKS_CATEGORIE"
>
> I have no Content field ore somthing like this...
> So when i will search somthing, i need to search in ALL fields, but when i
> search "*:test" it dosent Work,
> And when i put "*" in the defaultSearchField" it dosent Work too
>
> How i can Search in ALL fields?
>
>   
Good morning! Its morning in Connecticut USA now ;)

Check out: http://wiki.apache.org/solr/DisMaxRequestHandler

You can specify multiple fields with the qf param.

Also see CopyFields: 
http://wiki.apache.org/solr/SchemaXml#head-586f22933e9952e9130029e14aaf0b9718b917c4

CopyFields let you copy the value from multiple fields to a single field 
during indexing. It doesn't show it at that spot on the wiki (it prob 
should), but you can use * in the names, eg

 <copyField source="*" dest="all_fields"/>

Looks at the example schema for more examples.


-- 
- Mark

http://www.lucidimagination.com