DIH - read datasource param values from property file or configure JNDI datasource

2009-03-19 Thread Shyamsunder Reddy

I am looking for a implementation of DIH feature: It also takes in a properties 
file for the data source configuration 
(http://issues.apache.org/jira/browse/SOLR-469)

I want to externalize the data source parameters like driver, url, user and 
password to property file outside the solr. My aim to hide the parameters from 
developer code in Production environment. So that admin can enter these values.

Or else can DIH read JNDI data source from server environment.

Let me know the best practice to follow in production environment?

Thanks
Shyamsunder




  

Re: Solr search with Auto Spellchecker

2009-03-17 Thread Shyamsunder Reddy
I have the same question in mind. How can I configure the same standard request 
handler to handle the spell check for given query?
I mean instead of calling 
http://localhost:8983/solr/spellCheckCompRH?q=*:*spellcheck.q=globl for 
spelling checking the following query request
should take care of both querying and spell checking:
http://localhost:8983/solr/select?q=globl


--- On Wed, 3/11/09, Shalin Shekhar Mangar shalinman...@gmail.com wrote:

From: Shalin Shekhar Mangar shalinman...@gmail.com
Subject: Re: Solr search with Auto Spellchecker
To: solr-user@lucene.apache.org
Date: Wednesday, March 11, 2009, 9:33 AM

On Wed, Mar 11, 2009 at 7:00 PM, Narayanan, Karthikeyan 
karthikeyan.naraya...@gs.com wrote:

 Is it possible get the search results from the spell corrected word in a
 single solr search query?.  Like I search for the word globl and the
 correct spelling is global.. The query should return results matching
 with the word global.  Would appreciate any ideas..


No, you'll need to make two queries.

-- 
Regards,
Shalin Shekhar Mangar.



  

Re: How to use spell checker

2009-03-17 Thread Shyamsunder Reddy
How can I configure the same standard request handler to handle the spell check 
for given query? I mean instead of calling 
http://localhost:8983/solr/spellCheckCompRH?q=*:*spellcheck.q=elepents for 
spelling checking the following query request
should take care of both querying and spell checking:
http://localhost:8983/solr/select?q=elepents

Thanks


--- On Tue, 3/3/09, Grant Ingersoll gsing...@apache.org wrote:

From: Grant Ingersoll gsing...@apache.org
Subject: Re: How to use spell checker
To: solr-user@lucene.apache.org
Date: Tuesday, March 3, 2009, 2:03 PM

See http://wiki.apache.org/solr/SpellCheckComponent


On Mar 3, 2009, at 1:23 AM, dabboo wrote:

 
 Hi,
 
 I am trying to implement the spell check feature in solr with lucene. for
 e.g. if any record contains elephants and user enters elepents, even
 then also, it should return the results with the correct spelling i.e.
 elephants.
 
 Please suggest.
 
 Thanks,
 Amit Garg
 --View this message in context: 
 http://www.nabble.com/How-to-use-spell-checker-tp22303127p22303127.html
 Sent from the Solr - User mailing list archive at Nabble.com.
 

--
Grant Ingersoll
http://www.lucidimagination.com/

Search the Lucene ecosystem (Lucene/Solr/Nutch/Mahout/Tika/Droids) using 
Solr/Lucene:
http://www.lucidimagination.com/search




  

Re: spellchecker: returning results even with misspelt words

2009-03-17 Thread Shyamsunder Reddy
I think if you use spellcheck.collate=true, you will still receive the
results for correct word and suggestion for wrong word.

I have name field (which is first name+last name) configured for spell
check. I have name entry: GUY  SHUMAKER. I am trying to find out person
names where either 'GUY' or 'SHUMAKER' or both are spelled wrong.

1. Last Name spelled wrong as 'SHAMAKER'

http://localhost:8090/solr/select?q=NAME:GUY%20SHAMAKERfq=TYPE:PERSONspellcheck=truespellcheck.collate=true

It return all results that match 'GUY' and spelling suggestion for
'SHAMAKER' as 'SHUMAKER'

2. First Name spelled wrong as 'GYY'

http://localhost:8090/solr/select?q=NAME:GYY
SHUMAKERfq=TYPE:PERSONspellcheck=truespellcheck.collate=true

It return No results and spelling suggestion for 'GYY' as 'GUY' and
collation as str name=collationNAME:guy SHUMAKER/str

Note:But here I expected result that match SHUAMKER

3. Both first name and last name spelled wrong as: GYY SHAMAKER
http://localhost:8090/solr/select?q=NAME:GYY%20SHAMAKERfq=TYPE:PERSONspellcheck=truespellcheck.collate=true

Here no results, but received suggestion for both words and collation.

It is similar to your scenario?

Also why NO results are returned for case 2.

--- On Tue, 3/17/09, Ingo Renner i...@typo3.org wrote:

From: Ingo Renner i...@typo3.org
Subject: spellchecker: returning results even with misspelt words
To: solr-user@lucene.apache.org
Date: Tuesday, March 17, 2009, 9:52 AM

Hi all,

I'd like to achieve the following:

When searching for e.g. two words, one of them being spelt correctly the other 
one misspelt I'd like to receive results for the correct word but would still 
like to get spelling suggestions for the wrong word.

Currently when I search for misspelt words I get suggestions, but no results at 
all although there would be results when searching for the correct word only.

Hope you understand what I want to achieve as it's a little hard to explain.


all the best
Ingo

--Ingo Renner
TYPO3 Core Developer, Release Manager TYPO3 4.2






  

Solr SpellCheker configuration for multiple fields same time

2009-03-17 Thread Shyamsunder Reddy
My advanced search option allows users to search for three different fields 
same time.
The fields are - first name, last name and org name. Now I have to add spell 
checking feature for the fields.

When wrong spelling is entered for each of these words like first name: jahn, 
last name: smath, org and org name: bpple

the search result should return a suggestion like (collation) firstname:john 
AND lastname:smith AND orgname: apple


What is the best approach to implement spell checking for these three different 
fields:

1. Build a single directory for all fields by copying them into a 'spell' field 
as:
    schema.xml configuration
    !--Setup simple analysis for spell checking--
    fieldType name=textSpell class=solr.TextField 
positionIncrementGap=100 
  analyzer
    tokenizer class=solr.StandardTokenizerFactory/
    filter class=solr.LowerCaseFilterFactory/
    filter class=solr.RemoveDuplicatesTokenFilterFactory/
  /analyzer
    /fieldType
    field name=FIRST_NAME type=text indexed=true stored=true/
    field name=LAST_NAME type=text indexed=true stored=true/
 field name=ORG_NAME type=text indexed=true stored=true 
required=true/
    field name=spell type=textSpell indexed=true stored=true 
multiValued=true/
    
    copyField source=FIRST_NAME dest=spell/
    copyField source=LAST_NAME dest=spell/
    copyField source=ORG_NAME dest=spell/
  
    solrconfig.xml configuration
    searchComponent name=spellcheck class=solr.SpellCheckComponent    
    str name=queryAnalyzerFieldTypetextSpell/str    
    lst name=spellchecker
  str name=namedefault/str
  str name=fieldspell/str
  str name=spellcheckIndexDir./spellchecker/str
    /lst
    /searchComponent

Now the queries:
1a. 
URL/select?q=FIRST_NAME:jahnLAST_NAME:smathORG_NAME:bpplespellcheck=true

The spell check searches against the dictionary './spllechecker' returns the 
suggestions as
FIRST_NAME:john, LAST_NAME:smath and ORG_NAME:apple. Works as expected.

1b. URL/select?q=LAST_NAME:jahnspellcheck=true
The spell check searches against the dictionary './spllechecker' returns the 
suggestions for LAST_NAME as 'john'
But there is no last name 'john' for the field LAST_NAME. So the sub sequent 
search returns NO results, which is not accepted.

So, this approach seems to be wrong for me..

2. Build a separate directory for each field. 
    schema.xml configuration
    !--Setup simple analysis for spell checking--
    fieldType name=textSpell class=solr.TextField 
positionIncrementGap=100 
  analyzer
    tokenizer class=solr.StandardTokenizerFactory/
    filter class=solr.LowerCaseFilterFactory/
    filter class=solr.RemoveDuplicatesTokenFilterFactory/
  /analyzer
    /fieldType
    field name=FIRST_NAME type=text indexed=true stored=true/
    field name=LAST_NAME type=text indexed=true stored=true/
 field name=ORG_NAME type=text indexed=true stored=true 
required=true/
    field name=spell_fname type=textSpell indexed=true stored=true 
multiValued=true/
    field name=spell_lname type=textSpell indexed=true stored=true 
multiValued=true/
    field name=spell_org_name type=textSpell indexed=true stored=true 
multiValued=true/
    
    copyField source=FIRST_NAME dest=spell_fname/
    copyField source=LAST_NAME dest=spell_lname/
    copyField source=ORG_NAME dest=spell_org_name/
  
    solrconfig.xml configuration
    searchComponent name=spellcheck class=solr.SpellCheckComponent    
    str name=queryAnalyzerFieldTypetextSpell/str    
    lst name=spellchecker
      str name=namefirstname/str
      str name=fieldspell_fname/str
      str name=spellcheckIndexDir./fname_spellchecker/str
    /lst  
    lst name=spellchecker
      str name=namelastname/str
      str name=fieldspell_lname/str
      str name=spellcheckIndexDir./lname_spellchecker/str
    /lst  
    lst name=spellchecker
      str name=nameoname/str
      str name=fieldspell_org_name/str
      str name=spellcheckIndexDir./orgname_spellchecker/str
    /lst
    /searchComponent
    
Now the queries:
1a. 
URL/select?q=FIRST_NAME:jahnLAST_NAME:smathORG_NAME:bpplespellcheck=true

How can I mention in the query to search against different dictionaries for 
different fields like
FIRST_NAME in fname_spellchecker, LAST_NAME in lname_spellchecker and ORG_NAME 
in orgname_spellchecker?

Or can I make the spell checker to store the field names and its values.

Please discuss my approaches and suggest a solution?



  

Search for a field whose value contains instead of begins with

2009-03-06 Thread Shyamsunder Reddy
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. 

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. 


Thanks





  

Re: Search for a field whose value contains instead of begins with

2009-03-06 Thread Shyamsunder Reddy
Thanks. I have configured the field as text and search is working fine.
But the results are not properly sorted. field name value is some
company names in NY.


Here is my search query:

http://localhost:8090/solr/select?fq=TYPE:ORGq=NAME:new%20yorksort=NAME%20descrows=100fl=NAME

here is my result list (extracted the results from XML).


I want this result to be sorted as:

 1. Show all Names that start with 'New York' first (that is by
search query). And sort all the names that start with 'New York'. eg.

  NEW YORK IMMIGRATION COALITION, INC.

  NEW YORK LEGAL ASSISTANCE GROUP 

  NEW YORK YOUTH AT RISK INC.   


 2. Sort the remaining results that contain the word 'New York'
as per the proximity (distance) of this word from the beginning of the
document.


Please let me know how can I achieve this result?

***

YWCA OF THE CITY OF NEW YORK

NEW YORK YOUTH AT RISK INC.

EAST NEW YORK URBAN YOUTH CORPS, INC.

YOUNG AUDIENCES NEW YORK, INC.

Yoswein New York, Inc.

Real Estate Board of New York,Inc.

CENTRAL PARKING SYSTEM OF NEW YORK, INC.

NEW YORK JUNIOR TENNIS LEAGUE, INC.

NCNW OF GREATER NEW YORK

LOCAL DEVELOPMENT CORP. EAST NEW YORK

EAST NEW YORK LEARNING CENTER, INC.

GIRLS INCORPORATED OF NEW YORK CITY

PLANNED PARENTHOOD OF NEW YORK CITY INC.

GIRL SCOUT COUNCIL OF GREATER NEW YORK

NEW YORK ROAD RUNNERS FOUNDATION

ACHIEVEMENT FIRST EAST NEW YORK SCHOOL

MAKE THE ROAD NEW YORK

LAWYERS ALLIANCE FOR NEW YORK

NEW YORK IMMIGRATION COALITION, INC.

NEW YORK LEGAL ASSISTANCE GROUP

VISITING NURSE SERVICE OF NEW YORK




--- On Fri, 3/6/09, Shalin Shekhar Mangar shalinman...@gmail.com wrote:

From: Shalin Shekhar Mangar shalinman...@gmail.com
Subject: Re: Search for a field whose value contains instead of begins with
To: solr-user@lucene.apache.org
Date: Friday, March 6, 2009, 2:14 PM

On Sat, Mar 7, 2009 at 12:40 AM, SJ sjh...@yahoo.com wrote:


 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/


Use the text data type (as given in the example schema). If you want the
field's original value to be returned in the results, use stored=true
otherwise false.

-- 
Regards,
Shalin Shekhar Mangar.