lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SJ <sjh...@yahoo.com>
Subject Re: Search for a field whose value contains instead of begins with
Date Fri, 06 Mar 2009 19:10:19 GMT

The nam' field defined as string. What is the best analyzer to analyze the
name field text (ie Apple Corporation or The Applemint Gimlet) into
individual tokens.
Also shall I use stored or not stored property.

<field name="NAME" type="string" indexed="true" stored="true"/>

Shalin Shekhar Mangar wrote:
> 
> On Fri, Mar 6, 2009 at 9:24 PM, Shyamsunder Reddy <sjhyam@yahoo.com>
> wrote:
> 
>> I am indexing a document with field 'name'. The values of the field
>> 'name'
>> are like: Apple Corp, Apple iPod, Apple Games, Indian Apple, West Apple
>> Corporation and  The Applemint Gimlet.
>>
>>
>> Now my question is how to configure the field 'name' in my Solr
>> configuration and schema, so that when I search for name:Apple.
>> The query should return results all entities that contain word the
>> 'Apple'.
>> And not just words that start with 'Apple'.
>> In this the expected result for the search query name:Apple are
>>  Apple Corp,
>>  Apple iPod,
>>  Apple Games
>>  Indian Apple,
>>  West Apple Corporation
>>  The Applemint Gimlet.
>>
> 
> How is the 'name' field defined in the schema? What is the query you are
> using?
> 
> I guess you'd need to index the names as text type.
> 
> 
>> Also another requirement is to sort the results that start with Apple as:
>>  Apple Corp,
>>  Apple Games
>>  Apple iPod,
>>  Indian Apple,
>>  West Apple Corporation
>>  The Applemint Gimlet.
>>
> 
> Use the sort parameter to your request e.g. sort=name asc
> 
> Also see http://wiki.apache.org/solr/CommonQueryParameters
> -- 
> Regards,
> Shalin Shekhar Mangar.
> 
> 

-- 
View this message in context: http://www.nabble.com/Search-for-a-field-whose-value-contains-instead-of-begins-with-tp22375189p22378688.html
Sent from the Solr - User mailing list archive at Nabble.com.


Mime
View raw message