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 Tim Mahy <ti...@infosupport.com> on 2008/04/02 10:46:25 UTC

Search exact terms

Hi all,

is there a Solr wide setting that with which I can achieve the following :

if I now search for q=onderwij, I also receive documents with results of "onderwijs" etc.. this is ofcourse the behavior that is described but if I search on "onderwij", I still get the "onderwijs" hits, I use for this field the type "text" from the schema.xml that is supplied with the default Solr. 

Is there a global setting on Solr to always search Exact ?

Greetings,

Tim





Info Support - http://www.infosupport.com 

Alle informatie in dit e-mailbericht is onder voorbehoud. Info Support is op geen enkele wijze aansprakelijk voor vergissingen of onjuistheden in dit bericht en staat niet in voor de juiste en volledige overbrenging van de inhoud hiervan. Op al de werkzaamheden door Info Support uitgevoerd en op al de aan ons gegeven opdrachten zijn - tenzij expliciet anders overeengekomen - onze Algemene Voorwaarden van toepassing, gedeponeerd bij de Kamer van Koophandel te Utrecht onder nr. 30135370. Een exemplaar zenden wij u op uw verzoek per omgaande kosteloos toe.

De informatie in dit e-mailbericht is uitsluitend bestemd voor de geadresseerde. Gebruik van deze informatie door anderen is verboden. Openbaarmaking, vermenigvuldiging, verspreiding en/of verstrekking van deze informatie aan derden is niet toegestaan. 

Dit e-mailbericht kan vertrouwelijke informatie bevatten. Indien u dit bericht dus per ongeluk ontvangt, stelt Info Support het op prijs als u de zender door een antwoord op deze e-mail hiervan op de hoogte brengt en deze e-mail vervolgens vernietigt. 

Re: Search exact terms

Posted by Umar Shah <um...@wisdomtap.com>.
If you want this behavior then the field type should not be 'text'.
for default fieldtype=text there are many filters applied before the values
are indexed, this includes stemming (reducing the word to root word,
removing s in ur case.

try using fieldtype=string instead. this will match strictly to the values
in the field (exact match, case sensitive)

try tweaking schema.xml in the conf folder .

you can tweak the definition in this file to be able to use delimiter/ case
filters as seems fir for your case.


-umar


2008/4/2 Tim Mahy <ti...@infosupport.com>:

> Hi all,
>
> is there a Solr wide setting that with which I can achieve the following :
>
> if I now search for q=onderwij, I also receive documents with results of
> "onderwijs" etc.. this is ofcourse the behavior that is described but if I
> search on "onderwij", I still get the "onderwijs" hits, I use for this field
> the type "text" from the schema.xml that is supplied with the default
> Solr.
>
> Is there a global setting on Solr to always search Exact ?
>
> Greetings,
>
> Tim
>
>
>
>
>
> Info Support - http://www.infosupport.com
>
> Alle informatie in dit e-mailbericht is onder voorbehoud. Info Support is
> op geen enkele wijze aansprakelijk voor vergissingen of onjuistheden in dit
> bericht en staat niet in voor de juiste en volledige overbrenging van de
> inhoud hiervan. Op al de werkzaamheden door Info Support uitgevoerd en op al
> de aan ons gegeven opdrachten zijn - tenzij expliciet anders overeengekomen
> - onze Algemene Voorwaarden van toepassing, gedeponeerd bij de Kamer van
> Koophandel te Utrecht onder nr. 30135370. Een exemplaar zenden wij u op uw
> verzoek per omgaande kosteloos toe.
>
> De informatie in dit e-mailbericht is uitsluitend bestemd voor de
> geadresseerde. Gebruik van deze informatie door anderen is verboden.
> Openbaarmaking, vermenigvuldiging, verspreiding en/of verstrekking van deze
> informatie aan derden is niet toegestaan.
>
> Dit e-mailbericht kan vertrouwelijke informatie bevatten. Indien u dit
> bericht dus per ongeluk ontvangt, stelt Info Support het op prijs als u de
> zender door een antwoord op deze e-mail hiervan op de hoogte brengt en deze
> e-mail vervolgens vernietigt.
>

RE: Search exact terms

Posted by "Norskog, Lance" <la...@divvio.com>.
This is confusing advice to a beginner. A string field will not find a
word in the middle of a sentence.

To get normal searches without this confusions, copy the 'text' type and
make a variant without the Stemmer. The problem is that you are using an
English language stemmer for what appears to be Dutch. There is a Dutch
stemmer, it might be better for your needs if the content is all Dutch.

To make an exact search field which still has helpful searching
properties, make another variant of text that breaks up words but does
not stem. You might also want to add the ISOLatin1 filter which maps all
European characters to USASCII equivalents. This is also very helpful
for multi-language searching.

Lance

-----Original Message-----
From: Ryan McKinley [mailto:ryantxu@gmail.com] 
Sent: Wednesday, April 02, 2008 7:06 AM
To: solr-user@lucene.apache.org
Subject: Re: Search exact terms

search is based on the fields you index and how you index them.

If you index using the "text" field -- with stemming etc, you will have
to search with the same criteria.

If you want exact search, consider the "string" type.  If you want both,
you can use the <copyField> to copy the same content into multiple
fields so it is searchable multiple ways

ryan



On Apr 2, 2008, at 4:46 AM, Tim Mahy wrote:
> Hi all,
>
> is there a Solr wide setting that with which I can achieve the 
> following :
>
> if I now search for q=onderwij, I also receive documents with results 
> of "onderwijs" etc.. this is ofcourse the behavior that is described 
> but if I search on "onderwij", I still get the "onderwijs"
> hits, I use for this field the type "text" from the schema.xml that is

> supplied with the default Solr.
>
> Is there a global setting on Solr to always search Exact ?
>
> Greetings,
>
> Tim
>
>
>
>
>
> Info Support - http://www.infosupport.com
>
> Alle informatie in dit e-mailbericht is onder voorbehoud. Info Support

> is op geen enkele wijze aansprakelijk voor vergissingen of 
> onjuistheden in dit bericht en staat niet in voor de juiste en 
> volledige overbrenging van de inhoud hiervan. Op al de werkzaamheden 
> door Info Support uitgevoerd en op al de aan ons gegeven opdrachten 
> zijn - tenzij expliciet anders overeengekomen - onze Algemene 
> Voorwaarden van toepassing, gedeponeerd bij de Kamer van Koophandel te

> Utrecht onder nr. 30135370. Een exemplaar zenden wij u op uw verzoek 
> per omgaande kosteloos toe.
>
> De informatie in dit e-mailbericht is uitsluitend bestemd voor de 
> geadresseerde. Gebruik van deze informatie door anderen is verboden.
> Openbaarmaking, vermenigvuldiging, verspreiding en/of verstrekking van

> deze informatie aan derden is niet toegestaan.
>
> Dit e-mailbericht kan vertrouwelijke informatie bevatten. Indien u dit

> bericht dus per ongeluk ontvangt, stelt Info Support het op prijs als 
> u de zender door een antwoord op deze e-mail hiervan op de hoogte 
> brengt en deze e-mail vervolgens vernietigt.


Re: Search exact terms

Posted by Ryan McKinley <ry...@gmail.com>.
search is based on the fields you index and how you index them.

If you index using the "text" field -- with stemming etc, you will  
have to search with the same criteria.

If you want exact search, consider the "string" type.  If you want  
both, you can use the <copyField> to copy the same content into  
multiple fields so it is searchable multiple ways

ryan



On Apr 2, 2008, at 4:46 AM, Tim Mahy wrote:
> Hi all,
>
> is there a Solr wide setting that with which I can achieve the  
> following :
>
> if I now search for q=onderwij, I also receive documents with  
> results of "onderwijs" etc.. this is ofcourse the behavior that is  
> described but if I search on "onderwij", I still get the "onderwijs"  
> hits, I use for this field the type "text" from the schema.xml that  
> is supplied with the default Solr.
>
> Is there a global setting on Solr to always search Exact ?
>
> Greetings,
>
> Tim
>
>
>
>
>
> Info Support - http://www.infosupport.com
>
> Alle informatie in dit e-mailbericht is onder voorbehoud. Info  
> Support is op geen enkele wijze aansprakelijk voor vergissingen of  
> onjuistheden in dit bericht en staat niet in voor de juiste en  
> volledige overbrenging van de inhoud hiervan. Op al de werkzaamheden  
> door Info Support uitgevoerd en op al de aan ons gegeven opdrachten  
> zijn - tenzij expliciet anders overeengekomen - onze Algemene  
> Voorwaarden van toepassing, gedeponeerd bij de Kamer van Koophandel  
> te Utrecht onder nr. 30135370. Een exemplaar zenden wij u op uw  
> verzoek per omgaande kosteloos toe.
>
> De informatie in dit e-mailbericht is uitsluitend bestemd voor de  
> geadresseerde. Gebruik van deze informatie door anderen is verboden.  
> Openbaarmaking, vermenigvuldiging, verspreiding en/of verstrekking  
> van deze informatie aan derden is niet toegestaan.
>
> Dit e-mailbericht kan vertrouwelijke informatie bevatten. Indien u  
> dit bericht dus per ongeluk ontvangt, stelt Info Support het op  
> prijs als u de zender door een antwoord op deze e-mail hiervan op de  
> hoogte brengt en deze e-mail vervolgens vernietigt.