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 PeriS <pe...@htcinc.com> on 2014/11/09 21:26:08 UTC

Search for partial name in Solr 4.x

I was wondering if there is a way to search on partial names? Ex; Field is a string and stores values like titles of a book; When searching part of the title may be supplied; How do I resolve this? Please let me know


Thanks
-PeriS






*** DISCLAIMER *** This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery.
NOTE: Regardless of content, this e-mail shall not operate to bind HTC Global Services to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose.



Re: Search for partial name in Solr 4.x

Posted by Otis Gospodnetic <ot...@gmail.com>.
Hi,

You may be looking for wildcard queries or ngrams.

Otis
 

> On Nov 9, 2014, at 3:26 PM, PeriS <pe...@htcinc.com> wrote:
> 
> I was wondering if there is a way to search on partial names? Ex; Field is a string and stores values like titles of a book; When searching part of the title may be supplied; How do I resolve this? Please let me know
> 
> 
> Thanks
> -PeriS
> 
> 
> 
> 
> 
> 
> *** DISCLAIMER *** This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery.
> NOTE: Regardless of content, this e-mail shall not operate to bind HTC Global Services to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose.
> 
> 

Re: Search for partial name in Solr 4.x

Posted by Jack Krupansky <ja...@basetechnology.com>.
Please post some examples of titles and queries that you expect should 
match. How "partial" can the title be? How "full" does it need to be? When 
there are multiple partial matches how are you expecting them to be ranked?

-- Jack Krupansky

-----Original Message----- 
From: PeriS
Sent: Sunday, November 9, 2014 3:26 PM
To: <so...@lucene.apache.org>
Subject: Search for partial name in Solr 4.x

I was wondering if there is a way to search on partial names? Ex; Field is a 
string and stores values like titles of a book; When searching part of the 
title may be supplied; How do I resolve this? Please let me know


Thanks
-PeriS






*** DISCLAIMER *** This is a PRIVATE message. If you are not the intended 
recipient, please delete without copying and kindly advise us by e-mail of 
the mistake in delivery.
NOTE: Regardless of content, this e-mail shall not operate to bind HTC 
Global Services to any order or other contract unless pursuant to explicit 
written agreement or government initiative expressly permitting the use of 
e-mail for such purpose.


Re: Search for partial name in Solr 4.x

Posted by Jorge Luis Betancourt Gonzalez <jl...@uci.cu>.
The whole idea behind Solr is to solve the problem that you just explain, in particular what you need is to define the title field as a solr.TextField and then define a tokenizer. The tokenizer essentially will transform the initial text into tokens. Solr has several tokenizers, each which its special characteristics, nevertheless one of the must commons is the StandardTokenizer, but again your choice will be influenced by how do you want to “divide” your initial text into “parts” or tokens. Basically when you fire a query against Solr (put it in simple words) will match the tokens of your query to the tokens stored in each of your documents, and the will output a list of matching documents.

One simple example of a fieldType you could use is:

	<fieldType name="text" class="solr.TextField" sortMissingLast="true">
            <analyzer>
                <tokenizer class="solr.StandardTokenizerFactory"/>
                <filter class="solr.LowerCaseFilterFactory"/>
            </analyzer>
        </fieldType>

In this case the tokenizer will split the initial text into the tokens, and then each token will be lowercased so when you query you wouldn’t have to worry about the capitalization of the terms.

Hope it helps

On Nov 9, 2014, at 3:26 PM, PeriS <pe...@htcinc.com> wrote:

> I was wondering if there is a way to search on partial names? Ex; Field is a string and stores values like titles of a book; When searching part of the title may be supplied; How do I resolve this? Please let me know
> 
> 
> Thanks
> -PeriS
> 
> 
> 
> 
> 
> 
> *** DISCLAIMER *** This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery.
> NOTE: Regardless of content, this e-mail shall not operate to bind HTC Global Services to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose.
> 
>