RE: Calculate score according to another indexed field

2013-02-15 Thread Pragyanshis Pattanaik
Hi,
Fixed the issue with document and formatting.
My schema is like below.

My need is to search only three subject fields and boost those subjects which 
has a higher Mark(Mark can be in between 1 - 10).
Again Top subjects will get a higher boost than preceding one's.
Like if a search term is present in Subject-Name-1,Then it will get a higher 
boost than Subject-Name-2 and Subject-Name-3.
Similarly Subject-Mark-1 will get higher boost than Subject-Mark-2 and 
Subject-Mark-3.
To achieve this i am querying over subject fields and my query looks like 
below.  
  
q=+Economics+Geography&wt=xml&deftype=edismax&qf=Subject-Name-1+Subject-Name-2+Subject-Name-3&bq=Subject-Name-1%3AEconomics%3BGeography^50.0+Subject-Mark-1%3A20^90.0+Subject-Mark-1%3A9^80.0+Subject-Mark-1%3A8^70.0+Subject-Mark-1%3A7^60.0+Subject-Name-2%3AEconomics%3BGeography^45.0+Subject-Mark-2%3A20^90.0+Subject-Mark-2%3A9^80.0+Subject-Mark-2%3A8^70.0+Subject-Mark-2%3A7^60.0+Subject-Name-3%3AEconomics%3BGeography^40.0+Subject-Mark-3%3A20^90.0+Subject-Mark-3%3A9^80.0+Subject-Mark-3%3A8^70.0+Subject-Mark-3%3A7^60.0

If i am having four documents like below

EconomicsGeographyHistory7
76

EconomicsHistoryGeography8
85

EconomicsHistoryGeography9
67

EconomicsMathematicsHistory7
76



then i am getting a higher score for last document which has only one of the 
search term !!!
But in my situation it is not applicable. My requirement is,if a document has 
only one term then they should get a lower score than the documents which are 
having both of the terms.
Is it happening because of idf(rarer terms give higher contribution to the 
total score) ?
Or there is something wrong with my query ?
Can anybody help me to achieve the desired output.
Thanks in advance


> Date: Thu, 7 Feb 2013 17:23:21 +0100
> From: jonas.birgan...@prisjakt.nu
> To: solr-user@lucene.apache.org
> Subject: Re: Calculate score according to another indexed field
> 
> On 2013-02-07 14:58, Pragyanshis Pattanaik wrote:
> > Hi,
> 
> Hi,
> 
> > My schema is like below
> > 
> >  
> >   > required="true" />
> >   > stored="true" required="true" />
> >   > required="true" />
> > 
> >
> > Product name will be passed as q parameter to solr.
> > Is there a way to affect score on the basis of "ProductRating" which is not 
> > passed as query parameter ?
> 
> You can use a boost function to achieve this.
> There are examples in the wiki: 
> <http://wiki.apache.org/solr/SolrRelevancyFAQ#How_can_I_change_the_score_of_a_document_based_on_the_.2Avalue.2A_of_a_field_.28say.2C_.22popularity.22.29>
> 
> A quick example:
> defType=dismax&qf=text&q=supervillians&bf=sqrt(ProductRating)
> 
> 
> Regards,
> -- 
> Jonas Birgander
  

RE: Why a phrase is getting searched against default fields in solr

2013-02-14 Thread Pragyanshis Pattanaik
Yes i did some changes with the requesthandler.I have added edismax and removed the df field specified there and Now 
its working as i expected.
Thanks for the help ahmet.

> Date: Thu, 14 Feb 2013 01:31:14 -0800
> From: iori...@yahoo.com
> Subject: RE: Why a phrase is getting searched against default fields in solr
> To: solr-user@lucene.apache.org
> 
> Hi,
> 
> instead of &edismax=true can you try &defType=edismax
> 
> ahmet
> 
> --- On Thu, 2/14/13, Pragyanshis Pattanaik  wrote:
> 
> > From: Pragyanshis Pattanaik 
> > Subject: RE: Why a phrase is getting searched against default fields in solr
> > To: "solr Forum" 
> > Date: Thursday, February 14, 2013, 10:21 AM
> > It is returning me all the documents
> > which contains the phrase as it is searching against
> > Defaultfield.my default field is like below
> >  > indexed="true" stored="false"
> > multiValued="true"/> > source="Product-Name-*"
> > dest="SearchableField"/> > source="Product-Description-*" dest="SearchableField"/>
> > I have defined SearchableField as default field.
> > Thanks,Pragyanshis
> > > Date: Wed, 13 Feb 2013 23:18:06 -0800
> > > From: iori...@yahoo.com
> > > Subject: Re: Why a phrase is getting searched against
> > default fields in solr
> > > To: solr-user@lucene.apache.org
> > > 
> > > Hi Pragyanshis,
> > > 
> > > What happens when you remove bq parameter? 
> > > 
> > > --- On Thu, 2/14/13, Pragyanshis Pattanaik 
> > wrote:
> > > 
> > > > From: Pragyanshis Pattanaik 
> > > > Subject: Why a phrase is getting searched against
> > default fields in solr
> > > > To: "solr Forum" 
> > > > Date: Thursday, February 14, 2013, 8:24 AM
> > > > Hi,
> > > > This might be a very silly question but i want to
> > know why
> > > > this is happening.If i am using edismax query
> > parser in solr
> > > > and passing query something like below
> > > > 
> > > >
> > > >
> > q=IPhone5&wt=xml&edismax=true&qf=Product-Name-0^100&bq=(Product-Rating-0%3A7^300+OR+Product-Rating-0%3A8^400+OR+Product-Rating-0%3A9^500+OR+Product-Rating-0%3A10^600+OR+Product-Rating-0%3A*)
> > > > Then why it is searching in default fields ?As i
> > am
> > > > specifying qf,it should search in the fields
> > specified in qf
> > > > parameter and boost those documents which has a
> > higher
> > > > rating.
> > > > Please correct me if my understanding is
> > wrong.Note:-I am
> > > > using SOLR 4.0 Alpha
> > > > Thanks,Pragyanshis
> > > > 
> > > >   
> > > >   
> > 
> > 
> >   
> >   
  

RE: Why a phrase is getting searched against default fields in solr

2013-02-14 Thread Pragyanshis Pattanaik
It is returning me all the documents which contains the phrase as it is 
searching against Defaultfield.my default field is like below
 
I have defined SearchableField as default field.
Thanks,Pragyanshis
> Date: Wed, 13 Feb 2013 23:18:06 -0800
> From: iori...@yahoo.com
> Subject: Re: Why a phrase is getting searched against default fields in solr
> To: solr-user@lucene.apache.org
> 
> Hi Pragyanshis,
> 
> What happens when you remove bq parameter? 
> 
> --- On Thu, 2/14/13, Pragyanshis Pattanaik  wrote:
> 
> > From: Pragyanshis Pattanaik 
> > Subject: Why a phrase is getting searched against default fields in solr
> > To: "solr Forum" 
> > Date: Thursday, February 14, 2013, 8:24 AM
> > Hi,
> > This might be a very silly question but i want to know why
> > this is happening.If i am using edismax query parser in solr
> > and passing query something like below
> > 
> >
> > q=IPhone5&wt=xml&edismax=true&qf=Product-Name-0^100&bq=(Product-Rating-0%3A7^300+OR+Product-Rating-0%3A8^400+OR+Product-Rating-0%3A9^500+OR+Product-Rating-0%3A10^600+OR+Product-Rating-0%3A*)
> > Then why it is searching in default fields ?As i am
> > specifying qf,it should search in the fields specified in qf
> > parameter and boost those documents which has a higher
> > rating.
> > Please correct me if my understanding is wrong.Note:-I am
> > using SOLR 4.0 Alpha
> > Thanks,Pragyanshis
> > 
> >   
> >   
  

RE: Search over dynamic fields

2013-02-13 Thread Pragyanshis Pattanaik
Or is there a way to achieve this using EDismax query parser ?

> From: pragyans...@outlook.com
> To: solr-user@lucene.apache.org
> Subject: RE: Search over dynamic fields
> Date: Wed, 13 Feb 2013 19:09:24 +0530
> 
> Formatted the mail again.
> Hi,
> I have two dynamic fields like "Product-Name-*" and "Product-Rating-*".One 
> document can contain 5 products and respective ratings like below.
> HTC Wildfire S name="Product-Name-1">Samsung Tab 2Samsung 
> NoteIPhone5 name="Product-Name-4">Nokia Lumia 720 name="Product-Rating-0">59 name="Product-Rating-2">79 name="Product-Rating-4">9
> In my current scnario, I have to boost the products which has a higher 
> rating(Only More then 6.Note-Rating will be between 1 to 10).If i want to 
> search for a perticular product name for example "IPhone5",then i am quering 
> like this
> (Product-Name-0:IPhone5 AND (Product-Rating-0:7^3 OR Product-Rating-0:8^4 OR 
> Product-Rating-0:9^5 OR Product-Rating-0:10^6)) OR (Product-Name-1:IPhone5 
> AND (Product-Rating-1:7^3 OR Product-Rating-1:8^4 OR Product-Rating-1:9^5 OR 
> Product-Rating-1:10^6)) OR(Product-Name-2:IPhone5 AND (Product-Rating-2:7^3 
> OR Product-Rating-2:8^4 OR Product-Rating-2:9^5 OR Product-Rating-2:10^6)) 
> OR(Product-Name-3:IPhone5 AND (Product-Rating-3:7^3 OR Product-Rating-3:8^4 
> OR Product-Rating-3:9^5 OR Product-Rating-3:10^6)) OR(Product-Name-4:IPhone5 
> AND (Product-Rating-4:7^3 OR Product-Rating-4:8^4 OR Product-Rating-4:9^5 OR 
> Product-Rating-4:10^6))
> I could have used Product-Name-*:IPhone5 to find all the documents but 
> problem is i dont know how to boost that product according to its respective 
> Product Rating .
> Can anybody guide me wheather i am following the right approach or not ?
> Or Is there any other approach to achieve this ?
> 
> Thanks,-Pragyanshis 
  

RE: Search over dynamic fields

2013-02-13 Thread Pragyanshis Pattanaik
Formatted the mail again.
Hi,
I have two dynamic fields like "Product-Name-*" and "Product-Rating-*".One 
document can contain 5 products and respective ratings like below.
HTC Wildfire SSamsung Tab 2Samsung 
NoteIPhone5Nokia Lumia 72059799
In my current scnario, I have to boost the products which has a higher 
rating(Only More then 6.Note-Rating will be between 1 to 10).If i want to 
search for a perticular product name for example "IPhone5",then i am quering 
like this
(Product-Name-0:IPhone5 AND (Product-Rating-0:7^3 OR Product-Rating-0:8^4 OR 
Product-Rating-0:9^5 OR Product-Rating-0:10^6)) OR (Product-Name-1:IPhone5 AND 
(Product-Rating-1:7^3 OR Product-Rating-1:8^4 OR Product-Rating-1:9^5 OR 
Product-Rating-1:10^6)) OR(Product-Name-2:IPhone5 AND (Product-Rating-2:7^3 OR 
Product-Rating-2:8^4 OR Product-Rating-2:9^5 OR Product-Rating-2:10^6)) 
OR(Product-Name-3:IPhone5 AND (Product-Rating-3:7^3 OR Product-Rating-3:8^4 OR 
Product-Rating-3:9^5 OR Product-Rating-3:10^6)) OR(Product-Name-4:IPhone5 AND 
(Product-Rating-4:7^3 OR Product-Rating-4:8^4 OR Product-Rating-4:9^5 OR 
Product-Rating-4:10^6))
I could have used Product-Name-*:IPhone5 to find all the documents but problem 
is i dont know how to boost that product according to its respective Product 
Rating .
Can anybody guide me wheather i am following the right approach or not ?
Or Is there any other approach to achieve this ?

Thanks,-Pragyanshis   

RE: Search a Phrase

2013-02-10 Thread Pragyanshis Pattanaik
Thanks Upayavira . Really helpful.
Cheers,Pragyanshis


> From: u...@odoko.co.uk
> To: solr-user@lucene.apache.org
> Subject: Re: Search a Phrase
> Date: Sun, 10 Feb 2013 20:39:23 +
> 
> If you have a field of type 'text_general', searching for:
> 
>  q=good microwave
> 
> Will find any documents with either 'good' or 'microwave' in them.
> 
> Searching for:
> 
>   q="good microwave"
> 
> will find any documents that contain both terms next to each other.
> 
>   q="good microwave"^5 good microwave
> 
> will find any documents that contain either term, but will boost
> documents that contain the terms next to each other above those that
> don't.
> 
> Note also, when Lucene scores a document, it uses a 'co-ordination
> factor' which takes into account the number of query terms that matched
> your document. Thus, a document matching both terms will score more
> highly than a document only matching one of them.
> 
> So, a part of the question is whether you wish to *only* show documents
> that include both terms, or whether you are happy for good matches to be
> prioritised.
> 
> Upayavira
> 
> On Sun, Feb 10, 2013, at 05:27 PM, Pragyanshis Pattanaik wrote:
> > Hi,
> > I did one work around to get all documents that contains "Good" or
> > "Microwave" or "Good Microwave",if i will pass "Good Microwave" as q
> > parameter please guide me wheather i am going in right direction or not.
> > I defined two field type(text_general and shingleString) in my schema
> > like below
> >  > positionIncrementGap="100"> 
> >  > class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"
> > enablePositionIncrements="true" /> > class="solr.LowerCaseFilterFactory"/> > type="query">  
> >   > words="stopwords.txt" enablePositionIncrements="true" />   
> >  
> > 
> >  > positionIncrementGap="100" omitNorms="true"> 
> >  > class="solr.LowerCaseFilterFactory"/> > class="solr.PositionFilterFactory" /> > type="query">   
> >  > outputUnigramIfNoNgram="true" maxShingleSize="99"/> > class="solr.PositionFilterFactory" /> > class="solr.LowerCaseFilterFactory"/>  
> > then while indexing i am adding all these field to two different copy
> > fields like below.
> >  > stored="false" multiValued="true"/>> dest="SearchableField"/>  > dest="SearchableField"/>  > dest="SearchableField"/>
> >  > stored="false" multiValued="true"/>> dest="SearchableField1"/> > dest="SearchableField1"/> > dest="SearchableField1"/>
> > And now if i am querying on both the fields SearchableField and
> > SearchableField1 i am getting all the documents which contains "Good" or
> > "Microwave" or "Good Microwave".Below is the query i am using to get all
> > the
> > documents.q=SearchableField%3AGood+Microwave%0ASearchableField1%3AGood+Microwave
> > But the documents containing the whole phrase "Good Microwave",are
> > getting a very low score.Can anybody guide me to get a higher score on
> > those documents which contains the whole phrase if at all my approach is
> > correct ?
> > Or can anybody guide me to achieve this ?
> > Thanks,Pragyanshis
> > > From: pragyans...@outlook.com
> > > To: solr-user@lucene.apache.org
> > > Subject: Search a Phrase
> > > Date: Thu, 7 Feb 2013 19:29:04 +0530
> > > 
> > > 
> > > 
> > > 
> > > Hi,
> > > 
> > > My schema is like below
> > > 
> > >
> > > 
> > >  > > stored="true" required="true" />
> > >  > > stored="true" required="true" />
> > >  > > required="true" />
> > >  > > stored="true" required="true" />
> > > 
> > > 
> > > and my text_general field is like below
> > > 
> > >  > > positionIncrementGap="100">
> > >   
> > > 
> > >  > > words="stopwords.txt" enablePositionIncrements="true" />
> > > 
> > >   
> > >   
> > > 
> > >  > > words="stopwords.txt" enablePositionIncrements="true" />
> > >  > > ignoreCase="true" expand="true"/>
> > > 
> > >   
> > > 
> > > 
> > > How can i search a Phrase("Good Microwave") over ProductDesription and 
> > > Product Feedback field ?
> > > Here some documents might contain only "Good" and some might contain only 
> > > "Microwave".
> > > 
> > > How to get all  documents that contains "Good" or "Microwave" or "Good 
> > > Microwave",if i will pass "Good Microwave" as q parameter  ?
> > > 
> > > 
> > > 
> > > Thanks in advance
> > > 
> > > 
> > > 
> >   
  

RE: Search a Phrase

2013-02-10 Thread Pragyanshis Pattanaik
Hi,
I did one work around to get all documents that contains "Good" or "Microwave" 
or "Good Microwave",if i will pass "Good Microwave" as q parameter please guide 
me wheather i am going in right direction or not.
I defined two field type(text_general and shingleString) in my schema like below
  
  
  

  
then while indexing i am adding all these field to two different copy fields 
like below.
 
   
And now if i am querying on both the fields SearchableField and 
SearchableField1 i am getting all the documents which contains "Good" or 
"Microwave" or "Good Microwave".Below is the query i am using to get all the 
documents.q=SearchableField%3AGood+Microwave%0ASearchableField1%3AGood+Microwave
But the documents containing the whole phrase "Good Microwave",are getting a 
very low score.Can anybody guide me to get a higher score on those documents 
which contains the whole phrase if at all my approach is correct ?
Or can anybody guide me to achieve this ?
Thanks,Pragyanshis
> From: pragyans...@outlook.com
> To: solr-user@lucene.apache.org
> Subject: Search a Phrase
> Date: Thu, 7 Feb 2013 19:29:04 +0530
> 
> 
> 
> 
> Hi,
> 
> My schema is like below
> 
>
> 
>  stored="true" required="true" />
>  stored="true" required="true" />
>  required="true" />
>  stored="true" required="true" />
> 
> 
> and my text_general field is like below
> 
>  positionIncrementGap="100">
>   
> 
>  words="stopwords.txt" enablePositionIncrements="true" />
> 
>   
>   
> 
>  words="stopwords.txt" enablePositionIncrements="true" />
>  ignoreCase="true" expand="true"/>
> 
>   
> 
> 
> How can i search a Phrase("Good Microwave") over ProductDesription and 
> Product Feedback field ?
> Here some documents might contain only "Good" and some might contain only 
> "Microwave".
> 
> How to get all  documents that contains "Good" or "Microwave" or "Good 
> Microwave",if i will pass "Good Microwave" as q parameter  ?
> 
> 
> 
> Thanks in advance
> 
> 
> 
  

Search a Phrase

2013-02-07 Thread Pragyanshis Pattanaik



Hi,

My schema is like below

   







and my text_general field is like below


  



  
  




  


How can i search a Phrase("Good Microwave") over ProductDesription and Product 
Feedback field ?
Here some documents might contain only "Good" and some might contain only 
"Microwave".

How to get all  documents that contains "Good" or "Microwave" or "Good 
Microwave",if i will pass "Good Microwave" as q parameter  ?



Thanks in advance


  

Calculate score according to another indexed field

2013-02-07 Thread Pragyanshis Pattanaik



Hi,

My schema is like below
   






Product name will be passed as q parameter to solr.
Is there a way to affect score on the basis of "ProductRating" which is not 
passed as query parameter ?


Or I need to go to solr source code and change the ranking algorithm ?

Please Guide me.

Thanks in advance

  

Need Help in Delta DataImport Scheduler using stored procedure.

2012-12-30 Thread Pragyanshis Pattanaik
Hi ,

 

Please help how I can schedule a delta dataimport by using DIHS. Please note
I have already followed the steps mentioned at below link.

http://wiki.apache.org/solr/DataImportHandler#Scheduling still I am not able
to succeed.

 

 

Can anybody tell me can I send Last solr Indexed time as parameter to any
procedure ?

Ex :- deltaImportQuery="[SP_GetAccountDetails] '${dih.last_index_time}'"

 

Or any way to achieve it ?

 

 

Thanks