NRT or similar for Solr 3.5?
Hi guys, I'm looking for NRT functionality or similar in Solr 3.5. Is that possible? >From what I understand there's NRT in Solr 4, but I can't figure out whether or not 3.5 can do it as well? If not, is it feasible to use an autoCommit every 1000ms? We don't currently process *that* much data so I wonder if it's OK to just commit very often? Obviously not scalable on a large scale, but it is feasible for a relatively small amount of data? I recently upgraded from Solr 1.4 to 3.5. I had a hard time getting everything working smoothly and the process ended up taking my site down for a couple hours. I am very hesitant to upgrade to Solr 4 if it's not necessary to get some sort of NRT functionality. Can anyone help me? Thanks! -- Steven Ou | 歐偉凡 *ravn.com* | Chief Technology Officer steve...@gmail.com | +1 909-569-9880
Re: NRT or similar for Solr 3.5?
Hey Nagendra, I took a look and Solr-RA looks promising - but: - I could not figure out how to download it. It seems like all the download links just point to "#" - I wasn't looking for another ranking algorithm, so would it be possible for me to use NRT but *not* RA (i.e. just use the normal Lucene library)? -- Steven Ou | 歐偉凡 *ravn.com* | Chief Technology Officer steve...@gmail.com | +1 909-569-9880 On Sat, Dec 10, 2011 at 5:13 AM, Nagendra Nagarajayya < nnagaraja...@transaxtions.com> wrote: > Steven: > > Please take a look at Solr with RankingAlgorithm. It offers NRT > functionality. You can set your autoCommit to about 15 mins. You can get > more information from here: > http://solr-ra.tgels.com/wiki/**en/Near_Real_Time_Search_ver_**3.x<http://solr-ra.tgels.com/wiki/en/Near_Real_Time_Search_ver_3.x> > > > Regards, > > - Nagendra Nagarajayya > http://solr-ra.tgels.org > http://rankingalgorithm.tgels.**org <http://rankingalgorithm.tgels.org> > > > On 12/8/2011 9:30 PM, Steven Ou wrote: > >> Hi guys, >> >> I'm looking for NRT functionality or similar in Solr 3.5. Is that >> possible? >> > From what I understand there's NRT in Solr 4, but I can't figure out >> whether or not 3.5 can do it as well? >> >> If not, is it feasible to use an autoCommit every 1000ms? We don't >> currently process *that* much data so I wonder if it's OK to just commit >> >> very often? Obviously not scalable on a large scale, but it is feasible >> for >> a relatively small amount of data? >> >> I recently upgraded from Solr 1.4 to 3.5. I had a hard time getting >> everything working smoothly and the process ended up taking my site down >> for a couple hours. I am very hesitant to upgrade to Solr 4 if it's not >> necessary to get some sort of NRT functionality. >> >> Can anyone help me? Thanks! >> -- >> Steven Ou | 歐偉凡 >> >> *ravn.com* | Chief Technology Officer >> steve...@gmail.com | +1 909-569-9880 >> >> >
Re: NRT or similar for Solr 3.5?
All the links on the download section link to http://solr-ra.tgels.org/# -- Steven Ou | 歐偉凡 *ravn.com* | Chief Technology Officer steve...@gmail.com | +1 909-569-9880 2011/12/11 Nagendra Nagarajayya > Steven: > > Not sure why you had problems, #downloads ( > http://solr-ra.tgels.org/#downloads ) should point you to the downloads > section showing the different versions available for download ? Please > share if this is not so ( there were downloads yesterday with no problems ) > > Regarding NRT, you can switch between RA and Lucene at query level or at > config level; in the current version with RA, NRT is in effect while > with lucene, it is not, you can get more information from here: > http://solr-ra.tgels.org/papers/Solr34_with_RankingAlgorithm13.pdf > > Solr 3.5 with RankingAlgorithm 1.3 should be available next week. > > Regards, > > - Nagendra Nagarajayya > http://solr-ra.tgels.org > http://rankingalgorithm.tgels.org > > On 12/9/2011 4:49 PM, Steven Ou wrote: > > Hey Nagendra, > > > > I took a look and Solr-RA looks promising - but: > > > >- I could not figure out how to download it. It seems like all the > >download links just point to "#" > >- I wasn't looking for another ranking algorithm, so would it be > >possible for me to use NRT but *not* RA (i.e. just use the normal > Lucene > >library)? > > > > -- > > Steven Ou | 歐偉凡 > > > > *ravn.com* | Chief Technology Officer > > steve...@gmail.com | +1 909-569-9880 > > > > > > On Sat, Dec 10, 2011 at 5:13 AM, Nagendra Nagarajayya < > > nnagaraja...@transaxtions.com> wrote: > > > >> Steven: > >> > >> Please take a look at Solr with RankingAlgorithm. It offers NRT > >> functionality. You can set your autoCommit to about 15 mins. You can get > >> more information from here: > >> http://solr-ra.tgels.com/wiki/**en/Near_Real_Time_Search_ver_**3.x< > http://solr-ra.tgels.com/wiki/en/Near_Real_Time_Search_ver_3.x> > >> > >> > >> Regards, > >> > >> - Nagendra Nagarajayya > >> http://solr-ra.tgels.org > >> http://rankingalgorithm.tgels.**org <http://rankingalgorithm.tgels.org> > >> > >> > >> On 12/8/2011 9:30 PM, Steven Ou wrote: > >> > >>> Hi guys, > >>> > >>> I'm looking for NRT functionality or similar in Solr 3.5. Is that > >>> possible? > >>>> From what I understand there's NRT in Solr 4, but I can't figure out > >>> whether or not 3.5 can do it as well? > >>> > >>> If not, is it feasible to use an autoCommit every 1000ms? We don't > >>> currently process *that* much data so I wonder if it's OK to just > commit > >>> > >>> very often? Obviously not scalable on a large scale, but it is feasible > >>> for > >>> a relatively small amount of data? > >>> > >>> I recently upgraded from Solr 1.4 to 3.5. I had a hard time getting > >>> everything working smoothly and the process ended up taking my site > down > >>> for a couple hours. I am very hesitant to upgrade to Solr 4 if it's not > >>> necessary to get some sort of NRT functionality. > >>> > >>> Can anyone help me? Thanks! > >>> -- > >>> Steven Ou | 歐偉凡 > >>> > >>> *ravn.com* | Chief Technology Officer > >>> steve...@gmail.com | +1 909-569-9880 > >>> > >>> > >
Re: NRT or similar for Solr 3.5?
Yeah, running Chrome on OSX and doesn't do anything. Just switched to Firefox and it works. *But*, also don't seem to be receiving confirmation email. -- Steven Ou | 歐偉凡 *ravn.com* | Chief Technology Officer steve...@gmail.com | +1 909-569-9880 2011/12/12 vikram kamath > The Onclick handler does not seem to be called on google chrome (Ubuntu ). > > Also , I dont seem to receive the email with the confirmation link on > registering (I have checked my spam) > > > > > Regards > Vikram Kamath > > > > 2011/12/12 Nagendra Nagarajayya > > > Steven: > > > > There is an onclick handler that allows you to download the src. BTW, an > > early access Solr 3.5 with RankingAlgorithm 1.3 (NRT) release is > > available for download. So please give it a try. > > > > Regards, > > > > - Nagendra Nagarajayya > > http://solr-ra.tgels.org > > http://rankingalgorithm.tgels.org > > > > > > On 12/10/2011 11:18 PM, Steven Ou wrote: > > > All the links on the download section link to > http://solr-ra.tgels.org/# > > > -- > > > Steven Ou | 歐偉凡 > > > > > > *ravn.com* | Chief Technology Officer > > > steve...@gmail.com | +1 909-569-9880 > > > > > > > > > 2011/12/11 Nagendra Nagarajayya > > > > > >> Steven: > > >> > > >> Not sure why you had problems, #downloads ( > > >> http://solr-ra.tgels.org/#downloads ) should point you to the > downloads > > >> section showing the different versions available for download ? Please > > >> share if this is not so ( there were downloads yesterday with no > > problems ) > > >> > > >> Regarding NRT, you can switch between RA and Lucene at query level or > at > > >> config level; in the current version with RA, NRT is in effect while > > >> with lucene, it is not, you can get more information from here: > > >> http://solr-ra.tgels.org/papers/Solr34_with_RankingAlgorithm13.pdf > > >> > > >> Solr 3.5 with RankingAlgorithm 1.3 should be available next week. > > >> > > >> Regards, > > >> > > >> - Nagendra Nagarajayya > > >> http://solr-ra.tgels.org > > >> http://rankingalgorithm.tgels.org > > >> > > >> On 12/9/2011 4:49 PM, Steven Ou wrote: > > >>> Hey Nagendra, > > >>> > > >>> I took a look and Solr-RA looks promising - but: > > >>> > > >>>- I could not figure out how to download it. It seems like all the > > >>>download links just point to "#" > > >>>- I wasn't looking for another ranking algorithm, so would it be > > >>>possible for me to use NRT but *not* RA (i.e. just use the normal > > >> Lucene > > >>>library)? > > >>> > > >>> -- > > >>> Steven Ou | 歐偉凡 > > >>> > > >>> *ravn.com* | Chief Technology Officer > > >>> steve...@gmail.com | +1 909-569-9880 > > >>> > > >>> > > >>> On Sat, Dec 10, 2011 at 5:13 AM, Nagendra Nagarajayya < > > >>> nnagaraja...@transaxtions.com> wrote: > > >>> > > >>>> Steven: > > >>>> > > >>>> Please take a look at Solr with RankingAlgorithm. It offers NRT > > >>>> functionality. You can set your autoCommit to about 15 mins. You can > > get > > >>>> more information from here: > > >>>> http://solr-ra.tgels.com/wiki/**en/Near_Real_Time_Search_ver_**3.x< > > >> http://solr-ra.tgels.com/wiki/en/Near_Real_Time_Search_ver_3.x> > > >>>> > > >>>> Regards, > > >>>> > > >>>> - Nagendra Nagarajayya > > >>>> http://solr-ra.tgels.org > > >>>> http://rankingalgorithm.tgels.**org < > > http://rankingalgorithm.tgels.org> > > >>>> > > >>>> > > >>>> On 12/8/2011 9:30 PM, Steven Ou wrote: > > >>>> > > >>>>> Hi guys, > > >>>>> > > >>>>> I'm looking for NRT functionality or similar in Solr 3.5. Is that > > >>>>> possible? > > >>>>>> From what I understand there's NRT in Solr 4, but I can't figure > out > > >>>>> whether or not 3.5 can do it as well? > > >>>>> > > >>>>> If not, is it feasible to use an autoCommit every 1000ms? We don't > > >>>>> currently process *that* much data so I wonder if it's OK to just > > >> commit > > >>>>> very often? Obviously not scalable on a large scale, but it is > > feasible > > >>>>> for > > >>>>> a relatively small amount of data? > > >>>>> > > >>>>> I recently upgraded from Solr 1.4 to 3.5. I had a hard time getting > > >>>>> everything working smoothly and the process ended up taking my site > > >> down > > >>>>> for a couple hours. I am very hesitant to upgrade to Solr 4 if it's > > not > > >>>>> necessary to get some sort of NRT functionality. > > >>>>> > > >>>>> Can anyone help me? Thanks! > > >>>>> -- > > >>>>> Steven Ou | 歐偉凡 > > >>>>> > > >>>>> *ravn.com* | Chief Technology Officer > > >>>>> steve...@gmail.com | +1 909-569-9880 > > >>>>> > > >>>>> > > >> > > > > >
Re: NRT or similar for Solr 3.5?
Hey Vikram, I finally got around to getting Solr-RA installed but I'm having trouble getting the NRT to work. Could you help me out? I added these four lines immediately after in solrconfig.xml: true rankingalgorithm true rankingalgorithm Is that correct? I also read something about disabling caching, so I took out the queryResultCache. Is that right? What else do I need to do to get NRT working? Do I need to switch some engine to Solr-RA? If so, how do I do that? Are there other caches I need to disable? Any help appreciated. Thanks. -- Steven Ou | 歐偉凡 *ravn.com* | Chief Technology Officer steve...@gmail.com | +1 909-569-9880 2011/12/12 vikram kamath > @Steven .. try some alternate email address(besides google/yahoo) and > check your spam > > [image: twitter] <http://twitter.com/kmarkiv>[image: > facebook]<http://facebook.com/kmarkiv>[image: > google-buzz] <http://profiles.google.com/kmarkiv#buzz>[image: > linkedin]<http://linkedin.com/in/vikramkamathc> > > Regards > Vikram Kamath > > > > 2011/12/13 Steven Ou > > > Yeah, running Chrome on OSX and doesn't do anything. > > > > Just switched to Firefox and it works. *But*, also don't seem to be > > receiving confirmation email. > > -- > > Steven Ou | 歐偉凡 > > > > *ravn.com* | Chief Technology Officer > > steve...@gmail.com | +1 909-569-9880 > > > > > > 2011/12/12 vikram kamath > > > > > The Onclick handler does not seem to be called on google chrome (Ubuntu > > ). > > > > > > Also , I dont seem to receive the email with the confirmation link on > > > registering (I have checked my spam) > > > > > > > > > > > > > > > Regards > > > Vikram Kamath > > > > > > > > > > > > 2011/12/12 Nagendra Nagarajayya > > > > > > > Steven: > > > > > > > > There is an onclick handler that allows you to download the src. BTW, > > an > > > > early access Solr 3.5 with RankingAlgorithm 1.3 (NRT) release is > > > > available for download. So please give it a try. > > > > > > > > Regards, > > > > > > > > - Nagendra Nagarajayya > > > > http://solr-ra.tgels.org > > > > http://rankingalgorithm.tgels.org > > > > > > > > > > > > On 12/10/2011 11:18 PM, Steven Ou wrote: > > > > > All the links on the download section link to > > > http://solr-ra.tgels.org/# > > > > > -- > > > > > Steven Ou | 歐偉凡 > > > > > > > > > > *ravn.com* | Chief Technology Officer > > > > > steve...@gmail.com | +1 909-569-9880 > > > > > > > > > > > > > > > 2011/12/11 Nagendra Nagarajayya > > > > > > > > > >> Steven: > > > > >> > > > > >> Not sure why you had problems, #downloads ( > > > > >> http://solr-ra.tgels.org/#downloads ) should point you to the > > > downloads > > > > >> section showing the different versions available for download ? > > Please > > > > >> share if this is not so ( there were downloads yesterday with no > > > > problems ) > > > > >> > > > > >> Regarding NRT, you can switch between RA and Lucene at query level > > or > > > at > > > > >> config level; in the current version with RA, NRT is in effect > while > > > > >> with lucene, it is not, you can get more information from here: > > > > >> > http://solr-ra.tgels.org/papers/Solr34_with_RankingAlgorithm13.pdf > > > > >> > > > > >> Solr 3.5 with RankingAlgorithm 1.3 should be available next week. > > > > >> > > > > >> Regards, > > > > >> > > > > >> - Nagendra Nagarajayya > > > > >> http://solr-ra.tgels.org > > > > >> http://rankingalgorithm.tgels.org > > > > >> > > > > >> On 12/9/2011 4:49 PM, Steven Ou wrote: > > > > >>> Hey Nagendra, > > > > >>> > > > > >>> I took a look and Solr-RA looks promising - but: > > > > >>> > > > > >>>- I could not figure out how to download it. It seems like all > > the > > > > >>>download links just point to "#" > > > > >>>- I wasn't looking for a
Empty results with OR filter query
Hey guys, I'm stumped - hope someone can help! Basically, I'm running a filter query that filters by category (e.g. fq=category_ids_im:(637 OR 639 OR 634)). However, it often produces no results whatsoever even though each individual query *does* produce results. So, for example, fq=category_ids_im:*637* produces results. fq=category_ids_im:*639* produces results. fq=category_ids_im:*634* produces results. Even fq=category_ids_im:(*637* OR *639*) produces results, as well as fq=category_ids_im:(*639* OR *634*). BUT as soon as I do fq=category_ids_im:(*637* OR *639* OR *634*), it produces NO RESULTS! Any ideas what might be wrong? Really appreciate any help! -- Steven Ou | 歐偉凡 *ravn.com* | Chief Technology Officer steve...@gmail.com | +1 909-569-9880
Re: Empty results with OR filter query
Heh, yeah, I bolded the numbers for emphasis. The field type follows. *Dynamically Created From Pattern: **_IM<http://192.168.1.30:8080/solr/admin/schema.jsp#> *Field Type: *SINT <http://192.168.1.30:8080/solr/admin/schema.jsp#> *Schema: *Indexed, Multivalued, Omit Norms *Index: *(unstored field) *Index Analyzer: *org.apache.solr.schema.FieldType$DefaultAnalyzer *Query Analyzer: *org.apache.solr.schema.FieldType$DefaultAnalyzer *Docs: *33730 *Distinct: *528 -- Steven Ou | 歐偉凡 *ravn.com* | Chief Technology Officer steve...@gmail.com | +1 909-569-9880 On Thu, Feb 9, 2012 at 4:08 PM, Erik Hatcher wrote: > What type of field is category_ids_im? > > And I'm assuming that the *'s below are for emphasis and not really in > your query? > > Try your query in the q parameter and turn on debug (&debugQuery=true) and > see how your query is parsing. That'll likely tell all. > >Erik > > On Feb 9, 2012, at 18:42 , Steven Ou wrote: > > > Hey guys, I'm stumped - hope someone can help! > > > > Basically, I'm running a filter query that filters by category (e.g. > > fq=category_ids_im:(637 OR 639 OR 634)). However, it often produces no > > results whatsoever even though each individual query *does* produce > results. > > > > So, for example, fq=category_ids_im:*637* produces > > results. fq=category_ids_im:*639* produces results. > > fq=category_ids_im:*634* produces > > results. Even fq=category_ids_im:(*637* OR *639*) produces results, as > well > > as fq=category_ids_im:(*639* OR *634*). > > > > BUT as soon as I do fq=category_ids_im:(*637* OR *639* OR *634*), it > > produces NO RESULTS! > > > > Any ideas what might be wrong? Really appreciate any help! > > -- > > Steven Ou | 歐偉凡 > > > > *ravn.com* | Chief Technology Officer > > steve...@gmail.com | +1 909-569-9880 > >
Re: Empty results with OR filter query
I don't really know how to analyze the debug output... Here it is for the full query I'm running, which includes other filter queries. *:* *:* MatchAllDocsQuery(*:*) *:* LuceneQParser type:Event displayable_b:true category_ids_im:(637 OR 639 OR 634) end_datetime_dt:[2012\-02\-10T00\:17\:52Z TO *] {!geofilt} type:Event displayable_b:true category_ids_im:637 category_ids_im:639 category_ids_im:634 end_datetime_dt:[1328833072000 TO *] SpatialDistanceQuery(geofilt(latlonSource=coordinates_lls(double(coordinates_lls_0_coordinate),double(coordinates_lls_1_coordinate)),latCenter=37.7561438,lonCenter=-122.4325682,dist=50.0,latMin=37.30648363225355,latMax=38.20580396774645,lonMin=-123.0013021058511,lonMax-121.86383429414894,lon2Min=-180.0,lon2Max180.0,calcDist=true,planetRadius=6371.009)) 1.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -- Steven Ou | 歐偉凡 *ravn.com* | Chief Technology Officer steve...@gmail.com | +1 909-569-9880 On Thu, Feb 9, 2012 at 4:15 PM, Steven Ou wrote: > Heh, yeah, I bolded the numbers for emphasis. The field type follows. > > *Dynamically Created From Pattern: > **_IM<http://192.168.1.30:8080/solr/admin/schema.jsp#> > > *Field Type: *SINT <http://192.168.1.30:8080/solr/admin/schema.jsp#> > > *Schema: *Indexed, Multivalued, Omit Norms > > *Index: *(unstored field) > > *Index Analyzer: *org.apache.solr.schema.FieldType$DefaultAnalyzer > > *Query Analyzer: *org.apache.solr.schema.FieldType$DefaultAnalyzer > > *Docs: *33730 > > *Distinct: *528 > -- > Steven Ou | 歐偉凡 > > *ravn.com* | Chief Technology Officer > steve...@gmail.com | +1 909-569-9880 > > > > On Thu, Feb 9, 2012 at 4:08 PM, Erik Hatcher wrote: > >> What type of field is category_ids_im? >> >> And I'm assuming that the *'s below are for emphasis and not really in >> your query? >> >> Try your query in the q parameter and turn on debug (&debugQuery=true) >> and see how your query is parsing. That'll likely tell all. >> >>Erik >> >> On Feb 9, 2012, at 18:42 , Steven Ou wrote: >> >> > Hey guys, I'm stumped - hope someone can help! >> > >> > Basically, I'm running a filter query that filters by category (e.g. >> > fq=category_ids_im:(637 OR 639 OR 634)). However, it often produces no >> > results whatsoever even though each individual query *does* produce >> results. >> > >> > So, for example, fq=category_ids_im:*637* produces >> > results. fq=category_ids_im:*639* produces results. >> > fq=category_ids_im:*634* produces >> > results. Even fq=category_ids_im:(*637* OR *639*) produces results, as >> well >> > as fq=category_ids_im:(*639* OR *634*). >> > >> > BUT as soon as I do fq=category_ids_im:(*637* OR *639* OR *634*), it >> > produces NO RESULTS! >> > >> > Any ideas what might be wrong? Really appreciate any help! >> > -- >> > Steven Ou | 歐偉凡 >> > >> > *ravn.com* | Chief Technology Officer >> > steve...@gmail.com | +1 909-569-9880 >> >> >
Re: Empty results with OR filter query
By turning fq=category_ids_im:(637+OR+639+OR+634) to q=category_ids_im:(637+OR+639+OR+634) it appears to produce the correct results. But... that doesn't seem to make sense to me? Shouldn't it work just fine as a filter query? -- Steven Ou | 歐偉凡 *ravn.com* | Chief Technology Officer steve...@gmail.com | +1 909-569-9880 On Thu, Feb 9, 2012 at 4:20 PM, Steven Ou wrote: > I don't really know how to analyze the debug output... Here it is for the > full query I'm running, which includes other filter queries. > > > *:* > *:* > MatchAllDocsQuery(*:*) > *:* > > LuceneQParser > > type:Event > displayable_b:true > category_ids_im:(637 OR 639 OR 634) > end_datetime_dt:[2012\-02\-10T00\:17\:52Z TO *] > {!geofilt} > > > type:Event > displayable_b:true > > category_ids_im:637 category_ids_im:639 category_ids_im:634 > > end_datetime_dt:[1328833072000 TO *] > > > SpatialDistanceQuery(geofilt(latlonSource=coordinates_lls(double(coordinates_lls_0_coordinate),double(coordinates_lls_1_coordinate)),latCenter=37.7561438,lonCenter=-122.4325682,dist=50.0,latMin=37.30648363225355,latMax=38.20580396774645,lonMin=-123.0013021058511,lonMax-121.86383429414894,lon2Min=-180.0,lon2Max180.0,calcDist=true,planetRadius=6371.009)) > > > > 1.0 > > 1.0 > > 1.0 > > > 0.0 > > > 0.0 > > > 0.0 > > > 0.0 > > > 0.0 > > > > 0.0 > > 0.0 > > > 0.0 > > > 0.0 > > > 0.0 > > > 0.0 > > > 0.0 > > > > > -- > Steven Ou | 歐偉凡 > > *ravn.com* | Chief Technology Officer > steve...@gmail.com | +1 909-569-9880 > > > On Thu, Feb 9, 2012 at 4:15 PM, Steven Ou wrote: > >> Heh, yeah, I bolded the numbers for emphasis. The field type follows. >> >> *Dynamically Created From Pattern: >> **_IM<http://192.168.1.30:8080/solr/admin/schema.jsp#> >> >> *Field Type: *SINT <http://192.168.1.30:8080/solr/admin/schema.jsp#> >> >> *Schema: *Indexed, Multivalued, Omit Norms >> >> *Index: *(unstored field) >> >> *Index Analyzer: *org.apache.solr.schema.FieldType$DefaultAnalyzer >> >> *Query Analyzer: *org.apache.solr.schema.FieldType$DefaultAnalyzer >> >> *Docs: *33730 >> >> *Distinct: *528 >> -- >> Steven Ou | 歐偉凡 >> >> *ravn.com* | Chief Technology Officer >> steve...@gmail.com | +1 909-569-9880 >> >> >> >> On Thu, Feb 9, 2012 at 4:08 PM, Erik Hatcher wrote: >> >>> What type of field is category_ids_im? >>> >>> And I'm assuming that the *'s below are for emphasis and not really in >>> your query? >>> >>> Try your query in the q parameter and turn on debug (&debugQuery=true) >>> and see how your query is parsing. That'll likely tell all. >>> >>>Erik >>> >>> On Feb 9, 2012, at 18:42 , Steven Ou wrote: >>> >>> > Hey guys, I'm stumped - hope someone can help! >>> > >>> > Basically, I'm running a filter query that filters by category (e.g. >>> > fq=category_ids_im:(637 OR 639 OR 634)). However, it often produces no >>> > results whatsoever even though each individual query *does* produce >>> results. >>> > >>> > So, for example, fq=category_ids_im:*637* produces >>> > results. fq=category_ids_im:*639* produces results. >>> > fq=category_ids_im:*634* produces >>> > results. Even fq=category_ids_im:(*637* OR *639*) produces results, as >>> well >>> > as fq=category_ids_im:(*639* OR *634*). >>> > >>> > BUT as soon as I do fq=category_ids_im:(*637* OR *639* OR *634*), it >>> > produces NO RESULTS! >>> > >>> > Any ideas what might be wrong? Really appreciate any help! >>> > -- >>> > Steven Ou | 歐偉凡 >>> > >>> > *ravn.com* | Chief Technology Officer >>> > steve...@gmail.com | +1 909-569-9880 >>> >>> >> >
Re: Empty results with OR filter query
Well, keeping all other filter queries the same, changing fq= category_ids_im:(637+OR+639) to fq=category_ids_im:(637+OR+639+OR+634) causes results to not show up. In fact, I took out *all* other filter queries. And while I wasn't able to reproduce it exactly, nonetheless when I added the third category id the number of results *went down*. Which is consistently inconsistent, per se. Adding an OR cannot, logically, reduce the number of results! -- Steven Ou | 歐偉凡 *ravn.com* | Chief Technology Officer steve...@gmail.com | +1 909-569-9880 On Thu, Feb 9, 2012 at 4:39 PM, Erik Hatcher wrote: > Yes, certainly should work fine as a filter query... I was merely trying > to eliminate variables from the equation. You've got several filters and a > q=*:* going on below, so it's obviously harder to pinpoint what could be > going wrong. I suggest continuing to eliminate variables here, as more > than likely some other filter is causing the documents you think should > appear to be filtered out. > >Erik > > > > On Feb 9, 2012, at 19:24 , Steven Ou wrote: > > > By turning fq=category_ids_im:(637+OR+639+OR+634) to > > q=category_ids_im:(637+OR+639+OR+634) > > it appears to produce the correct results. But... that doesn't seem to > make > > sense to me? Shouldn't it work just fine as a filter query? > > -- > > Steven Ou | 歐偉凡 > > > > *ravn.com* | Chief Technology Officer > > steve...@gmail.com | +1 909-569-9880 > > > > > > On Thu, Feb 9, 2012 at 4:20 PM, Steven Ou wrote: > > > >> I don't really know how to analyze the debug output... Here it is for > the > >> full query I'm running, which includes other filter queries. > >> > >> > >> *:* > >> *:* > >> MatchAllDocsQuery(*:*) > >> *:* > >> > >> LuceneQParser > >> > >> type:Event > >> displayable_b:true > >> category_ids_im:(637 OR 639 OR 634) > >> end_datetime_dt:[2012\-02\-10T00\:17\:52Z TO *] > >> {!geofilt} > >> > >> > >> type:Event > >> displayable_b:true > >> > >> category_ids_im:637 category_ids_im:639 category_ids_im:634 > >> > >> end_datetime_dt:[1328833072000 TO *] > >> > >> > >> > SpatialDistanceQuery(geofilt(latlonSource=coordinates_lls(double(coordinates_lls_0_coordinate),double(coordinates_lls_1_coordinate)),latCenter=37.7561438,lonCenter=-122.4325682,dist=50.0,latMin=37.30648363225355,latMax=38.20580396774645,lonMin=-123.0013021058511,lonMax-121.86383429414894,lon2Min=-180.0,lon2Max180.0,calcDist=true,planetRadius=6371.009)) > >> > >> > >> > >> 1.0 > >> > >> 1.0 > >> > >> 1.0 > >> > >> > >> 0.0 > >> > >> > >> 0.0 > >> > >> > >> 0.0 > >> > >> > >> 0.0 > >> > >> > >> 0.0 > >> > >> > >> > >> 0.0 > >> > >> 0.0 > >> > >> > >> 0.0 > >> > >> > >> 0.0 > >> > >> > >> 0.0 > >> > >> > >> 0.0 > >> > >> > >> 0.0 > >> > >> > >> > >> > >> -- > >> Steven Ou | 歐偉凡 > >> > >> *ravn.com* | Chief Technology Officer > >> steve...@gmail.com | +1 909-569-9880 > >> > >> > >> On Thu, Feb 9, 2012 at 4:15 PM, Steven Ou wrote: > >> > >>> Heh, yeah, I bolded the numbers for emphasis. The field type follows. > >>> > >>> *Dynamically Created From Pattern: **_IM< > http://192.168.1.30:8080/solr/admin/schema.jsp#> > >>> > >>> *Field Type: *SINT <http://192.168.1.30:8080/solr/admin/schema.jsp#> > >>> > >>> *Schema: *Indexed, Multivalued, Omit Norms > >>> > >>> *Index: *(unstored field) > >>> > >>> *Index Analyzer: *org.apache.solr.schema.FieldType$DefaultAnalyzer > >>> > >>> *Query Analyzer: *org.apache.solr.schema.FieldType$DefaultAnalyzer > >>> > >>> *Docs: *33730 > >>> > >>> *Distinct: *528 > >>> -- > >>> Steven Ou | 歐偉凡 > >>> > >>> *ravn.com* | Chief Technology Officer > >>> steve...@gmail.com | +1 909-569-9880 > >>> > >>> > >>> > >>> On Thu, Feb 9, 2012 at 4:08 PM, Erik Hatcher >wrote
Re: Empty results with OR filter query
Actually, I take that back. Using q instead of fq still produces the same problem. Somehow it's *less* inconsistent so at first glance it looked like it fixed it. However, it does *not* fix it :( -- Steven Ou | 歐偉凡 *ravn.com* | Chief Technology Officer steve...@gmail.com | +1 909-569-9880 On Thu, Feb 9, 2012 at 4:48 PM, Steven Ou wrote: > Well, keeping all other filter queries the same, changing fq= > category_ids_im:(637+OR+639) to fq=category_ids_im:(637+OR+639+OR+634) > causes results to not show up. > > In fact, I took out *all* other filter queries. And while I wasn't able > to reproduce it exactly, nonetheless when I added the third category id the > number of results *went down*. Which is consistently inconsistent, per > se. Adding an OR cannot, logically, reduce the number of results! > -- > Steven Ou | 歐偉凡 > > *ravn.com* | Chief Technology Officer > steve...@gmail.com | +1 909-569-9880 > > > > On Thu, Feb 9, 2012 at 4:39 PM, Erik Hatcher wrote: > >> Yes, certainly should work fine as a filter query... I was merely trying >> to eliminate variables from the equation. You've got several filters and a >> q=*:* going on below, so it's obviously harder to pinpoint what could be >> going wrong. I suggest continuing to eliminate variables here, as more >> than likely some other filter is causing the documents you think should >> appear to be filtered out. >> >>Erik >> >> >> >> On Feb 9, 2012, at 19:24 , Steven Ou wrote: >> >> > By turning fq=category_ids_im:(637+OR+639+OR+634) to >> > q=category_ids_im:(637+OR+639+OR+634) >> > it appears to produce the correct results. But... that doesn't seem to >> make >> > sense to me? Shouldn't it work just fine as a filter query? >> > -- >> > Steven Ou | 歐偉凡 >> > >> > *ravn.com* | Chief Technology Officer >> > steve...@gmail.com | +1 909-569-9880 >> > >> > >> > On Thu, Feb 9, 2012 at 4:20 PM, Steven Ou wrote: >> > >> >> I don't really know how to analyze the debug output... Here it is for >> the >> >> full query I'm running, which includes other filter queries. >> >> >> >> >> >> *:* >> >> *:* >> >> MatchAllDocsQuery(*:*) >> >> *:* >> >> >> >> LuceneQParser >> >> >> >> type:Event >> >> displayable_b:true >> >> category_ids_im:(637 OR 639 OR 634) >> >> end_datetime_dt:[2012\-02\-10T00\:17\:52Z TO *] >> >> {!geofilt} >> >> >> >> >> >> type:Event >> >> displayable_b:true >> >> >> >> category_ids_im:637 category_ids_im:639 category_ids_im:634 >> >> >> >> end_datetime_dt:[1328833072000 TO *] >> >> >> >> >> >> >> SpatialDistanceQuery(geofilt(latlonSource=coordinates_lls(double(coordinates_lls_0_coordinate),double(coordinates_lls_1_coordinate)),latCenter=37.7561438,lonCenter=-122.4325682,dist=50.0,latMin=37.30648363225355,latMax=38.20580396774645,lonMin=-123.0013021058511,lonMax-121.86383429414894,lon2Min=-180.0,lon2Max180.0,calcDist=true,planetRadius=6371.009)) >> >> >> >> >> >> >> >> 1.0 >> >> >> >> 1.0 >> >> >> >> 1.0 >> >> >> >> >> >> 0.0 >> >> >> >> >> >> 0.0 >> >> >> >> >> >> 0.0 >> >> >> >> >> >> 0.0 >> >> >> >> >> >> 0.0 >> >> >> >> >> >> >> >> 0.0 >> >> >> >> 0.0 >> >> >> >> >> >> 0.0 >> >> >> >> >> >> 0.0 >> >> >> >> >> >> 0.0 >> >> >> >> >> >> 0.0 >> >> >> >> >> >> 0.0 >> >> >> >> >> >> >> >> >> >> -- >> >> Steven Ou | 歐偉凡 >> >> >> >> *ravn.com* | Chief Technology Officer >> >> steve...@gmail.com | +1 909-569-9880 >> >> >> >> >> >> On Thu, Feb 9, 2012 at 4:15 PM, Steven Ou wrote: >> >> >> >>> Heh, yeah, I bolded the numbers for emphasis. The field type follows. >> >>> >> >>> *Dynamically Created From Pattern: **_IM< >> http://192.168.1.30:8080/sol
Re: Empty results with OR filter query
I'm really sorry to be spamming everyone. I know I've sent out a ton of emails, but I ran it without *any* other filters (just solr/select?q=category_ids_im:(637+OR+639+OR+634)&debugQuery=true) and here's the debug. This produces 1 result only. Removing category 634 produces 11 results. Can anyone help? I noticed the parsedquery_toString has weird symbols in it: category_ids_im:(637 OR 639 OR 634) category_ids_im:(637 OR 639 OR 634) category_ids_im:637 category_ids_im:639 category_ids_im:634 category_ids_im:€#0;ɽ category_ids_im:€#0;ɿ category_ids_im:€#0;ɺ 11.743038 = (MATCH) sum of: 4.007905 = (MATCH) weight(category_ids_im:€#0;ɽ in 4268), product of: 0.5842093 = queryWeight(category_ids_im:€#0;ɽ), product of: 6.860392 = idf(docFreq=187, maxDocs=65962) 0.08515684 = queryNorm 6.860392 = (MATCH) fieldWeight(category_ids_im:€#0;ɽ in 4268), product of: 1.0 = tf(termFreq(category_ids_im:€#0;ɽ)=1) 6.860392 = idf(docFreq=187, maxDocs=65962) 1.0 = fieldNorm(field=category_ids_im, doc=4268) 3.959362 = (MATCH) weight(category_ids_im:€#0;ɿ in 4268), product of: 0.58066064 = queryWeight(category_ids_im:€#0;ɿ), product of: 6.8187194 = idf(docFreq=195, maxDocs=65962) 0.08515684 = queryNorm 6.8187194 = (MATCH) fieldWeight(category_ids_im:€#0;ɿ in 4268), product of: 1.0 = tf(termFreq(category_ids_im:€#0;ɿ)=1) 6.8187194 = idf(docFreq=195, maxDocs=65962) 1.0 = fieldNorm(field=category_ids_im, doc=4268) 3.7757707 = (MATCH) weight(category_ids_im:€#0;ɺ in 4268), product of: 0.56703854 = queryWeight(category_ids_im:€#0;ɺ), product of: 6.658755 = idf(docFreq=229, maxDocs=65962) 0.08515684 = queryNorm 6.658755 = (MATCH) fieldWeight(category_ids_im:€#0;ɺ in 4268), product of: 1.0 = tf(termFreq(category_ids_im:€#0;ɺ)=1) 6.658755 = idf(docFreq=229, maxDocs=65962) 1.0 = fieldNorm(field=category_ids_im, doc=4268) LuceneQParser ... -- Steven Ou | 歐偉凡 *ravn.com* | Chief Technology Officer steve...@gmail.com | +1 909-569-9880 On Thu, Feb 9, 2012 at 4:53 PM, Steven Ou wrote: > Actually, I take that back. Using q instead of fq still produces the same > problem. Somehow it's *less* inconsistent so at first glance it looked > like it fixed it. However, it does *not* fix it :( > > -- > Steven Ou | 歐偉凡 > > *ravn.com* | Chief Technology Officer > steve...@gmail.com | +1 909-569-9880 > > > On Thu, Feb 9, 2012 at 4:48 PM, Steven Ou wrote: > >> Well, keeping all other filter queries the same, changing fq= >> category_ids_im:(637+OR+639) to fq=category_ids_im:(637+OR+639+OR+634) >> causes results to not show up. >> >> In fact, I took out *all* other filter queries. And while I wasn't able >> to reproduce it exactly, nonetheless when I added the third category id the >> number of results *went down*. Which is consistently inconsistent, per >> se. Adding an OR cannot, logically, reduce the number of results! >> -- >> Steven Ou | 歐偉凡 >> >> *ravn.com* | Chief Technology Officer >> steve...@gmail.com | +1 909-569-9880 >> >> >> >> On Thu, Feb 9, 2012 at 4:39 PM, Erik Hatcher wrote: >> >>> Yes, certainly should work fine as a filter query... I was merely trying >>> to eliminate variables from the equation. You've got several filters and a >>> q=*:* going on below, so it's obviously harder to pinpoint what could be >>> going wrong. I suggest continuing to eliminate variables here, as more >>> than likely some other filter is causing the documents you think should >>> appear to be filtered out. >>> >>>Erik >>> >>> >>> >>> On Feb 9, 2012, at 19:24 , Steven Ou wrote: >>> >>> > By turning fq=category_ids_im:(637+OR+639+OR+634) to >>> > q=category_ids_im:(637+OR+639+OR+634) >>> > it appears to produce the correct results. But... that doesn't seem to >>> make >>> > sense to me? Shouldn't it work just fine as a filter query? >>> > -- >>> > Steven Ou | 歐偉凡 >>> > >>> > *ravn.com* | Chief Technology Officer >>> > steve...@gmail.com | +1 909-569-9880 >>> > >>> > >>> > On Thu, Feb 9, 2012 at 4:20 PM, Steven Ou wrote: >>> > >>> >> I don't really know how to analyze the debug output... Here it is for >>> the >>> >> full query I'm running, which includes other filter queries. >>> >> >>> >> >>> >> *:* >>> >> *:* >>> >> MatchAllDocsQuery(*:*) >>> >> *:* >>> >> >>> >> LuceneQParser >>> >> >>> >> type:Event >>> >> displayable_b:true >>> >> cate
Re: Empty results with OR filter query
Sorry, what do you mean "explicit category rather than boolean expression"? Type was not changed midstream - hasn't really been changed ever, really. And I happen to have *just* reindexed, too. Don't seem to have a default operator set. Not sure how to do it, either...? -- Steven Ou | 歐偉凡 *ravn.com* | Chief Technology Officer steve...@gmail.com | +1 909-569-9880 On Thu, Feb 9, 2012 at 5:01 PM, Erik Hatcher wrote: > Extremely odd. > > Hmmm... other things to try: > > * query on an explicit category, rather than in a boolean expression > * try a different field type than sint (say just int, or string) > * shouldn't matter (since you're using "OR" explicitly) but double check > the default operator in schema.xml > * reindex (was the field type ever changed mid-stream?) > > Definitely something fishy here. Nothing obvious pops out yet. > >Erik > > > On Feb 9, 2012, at 19:53 , Steven Ou wrote: > > > Actually, I take that back. Using q instead of fq still produces the same > > problem. Somehow it's *less* inconsistent so at first glance it looked > like > > it fixed it. However, it does *not* fix it :( > > -- > > Steven Ou | 歐偉凡 > > > > *ravn.com* | Chief Technology Officer > > steve...@gmail.com | +1 909-569-9880 > > > > > > On Thu, Feb 9, 2012 at 4:48 PM, Steven Ou wrote: > > > >> Well, keeping all other filter queries the same, changing fq= > >> category_ids_im:(637+OR+639) to fq=category_ids_im:(637+OR+639+OR+634) > >> causes results to not show up. > >> > >> In fact, I took out *all* other filter queries. And while I wasn't able > >> to reproduce it exactly, nonetheless when I added the third category id > the > >> number of results *went down*. Which is consistently inconsistent, per > >> se. Adding an OR cannot, logically, reduce the number of results! > >> -- > >> Steven Ou | 歐偉凡 > >> > >> *ravn.com* | Chief Technology Officer > >> steve...@gmail.com | +1 909-569-9880 > >> > >> > >> > >> On Thu, Feb 9, 2012 at 4:39 PM, Erik Hatcher >wrote: > >> > >>> Yes, certainly should work fine as a filter query... I was merely > trying > >>> to eliminate variables from the equation. You've got several filters > and a > >>> q=*:* going on below, so it's obviously harder to pinpoint what could > be > >>> going wrong. I suggest continuing to eliminate variables here, as more > >>> than likely some other filter is causing the documents you think should > >>> appear to be filtered out. > >>> > >>> Erik > >>> > >>> > >>> > >>> On Feb 9, 2012, at 19:24 , Steven Ou wrote: > >>> > >>>> By turning fq=category_ids_im:(637+OR+639+OR+634) to > >>>> q=category_ids_im:(637+OR+639+OR+634) > >>>> it appears to produce the correct results. But... that doesn't seem to > >>> make > >>>> sense to me? Shouldn't it work just fine as a filter query? > >>>> -- > >>>> Steven Ou | 歐偉凡 > >>>> > >>>> *ravn.com* | Chief Technology Officer > >>>> steve...@gmail.com | +1 909-569-9880 > >>>> > >>>> > >>>> On Thu, Feb 9, 2012 at 4:20 PM, Steven Ou wrote: > >>>> > >>>>> I don't really know how to analyze the debug output... Here it is for > >>> the > >>>>> full query I'm running, which includes other filter queries. > >>>>> > >>>>> > >>>>> *:* > >>>>> *:* > >>>>> MatchAllDocsQuery(*:*) > >>>>> *:* > >>>>> > >>>>> LuceneQParser > >>>>> > >>>>> type:Event > >>>>> displayable_b:true > >>>>> category_ids_im:(637 OR 639 OR 634) > >>>>> end_datetime_dt:[2012\-02\-10T00\:17\:52Z TO *] > >>>>> {!geofilt} > >>>>> > >>>>> > >>>>> type:Event > >>>>> displayable_b:true > >>>>> > >>>>> category_ids_im:637 category_ids_im:639 category_ids_im:634 > >>>>> > >>>>> end_datetime_dt:[1328833072000 TO *] > >>>>> > >>>>> > >>>>> > >>> > SpatialDistanceQuery(geofilt(latlonSource=coordinates_lls(do
Re: Empty results with OR filter query
For anyone having this issue in the future: I managed to narrow it down to Solr-RA 3.5. Installing Solr 3.5 solved the issue. I don't really know how the internals of Solr-RA work, but it appears that it was using AND operators even when I explicitly used OR operators in the query. The other solution was to set defaultOperator to OR, but I wasn't sure how this would affect my other queries. Would explicit AND operators now become OR operators? Anyway, thanks to Erik for helping me troubleshoot this! -- Steven Ou | 歐偉凡 *ravn.com* | Chief Technology Officer steve...@gmail.com | +1 909-569-9880 On Thu, Feb 9, 2012 at 5:14 PM, Erik Hatcher wrote: > > On Feb 9, 2012, at 20:11 , Steven Ou wrote: > > > Sorry, what do you mean "explicit category rather than boolean > expression"? > > q=category_ids_im:634 for example. Just to get an idea of what matches > each category. > > > Type was not changed midstream - hasn't really been changed ever, really. > > And I happen to have *just* reindexed, too. > > > > Don't seem to have a default operator set. Not sure how to do it, > either...? > > Look at Solr's example schema.xml. It'll have it spelled out there. > >Erik > > > > -- > > Steven Ou | 歐偉凡 > > > > *ravn.com* | Chief Technology Officer > > steve...@gmail.com | +1 909-569-9880 > > > > > > On Thu, Feb 9, 2012 at 5:01 PM, Erik Hatcher > wrote: > > > >> Extremely odd. > >> > >> Hmmm... other things to try: > >> > >> * query on an explicit category, rather than in a boolean expression > >> * try a different field type than sint (say just int, or string) > >> * shouldn't matter (since you're using "OR" explicitly) but double check > >> the default operator in schema.xml > >> * reindex (was the field type ever changed mid-stream?) > >> > >> Definitely something fishy here. Nothing obvious pops out yet. > >> > >> Erik > >> > >> > >> On Feb 9, 2012, at 19:53 , Steven Ou wrote: > >> > >>> Actually, I take that back. Using q instead of fq still produces the > same > >>> problem. Somehow it's *less* inconsistent so at first glance it looked > >> like > >>> it fixed it. However, it does *not* fix it :( > >>> -- > >>> Steven Ou | 歐偉凡 > >>> > >>> *ravn.com* | Chief Technology Officer > >>> steve...@gmail.com | +1 909-569-9880 > >>> > >>> > >>> On Thu, Feb 9, 2012 at 4:48 PM, Steven Ou wrote: > >>> > >>>> Well, keeping all other filter queries the same, changing fq= > >>>> category_ids_im:(637+OR+639) to fq=category_ids_im:(637+OR+639+OR+634) > >>>> causes results to not show up. > >>>> > >>>> In fact, I took out *all* other filter queries. And while I wasn't > able > >>>> to reproduce it exactly, nonetheless when I added the third category > id > >> the > >>>> number of results *went down*. Which is consistently inconsistent, per > >>>> se. Adding an OR cannot, logically, reduce the number of results! > >>>> -- > >>>> Steven Ou | 歐偉凡 > >>>> > >>>> *ravn.com* | Chief Technology Officer > >>>> steve...@gmail.com | +1 909-569-9880 > >>>> > >>>> > >>>> > >>>> On Thu, Feb 9, 2012 at 4:39 PM, Erik Hatcher >>> wrote: > >>>> > >>>>> Yes, certainly should work fine as a filter query... I was merely > >> trying > >>>>> to eliminate variables from the equation. You've got several filters > >> and a > >>>>> q=*:* going on below, so it's obviously harder to pinpoint what could > >> be > >>>>> going wrong. I suggest continuing to eliminate variables here, as > more > >>>>> than likely some other filter is causing the documents you think > should > >>>>> appear to be filtered out. > >>>>> > >>>>> Erik > >>>>> > >>>>> > >>>>> > >>>>> On Feb 9, 2012, at 19:24 , Steven Ou wrote: > >>>>> > >>>>>> By turning fq=category_ids_im:(637+OR+639+OR+634) to > >>>>>> q=category_ids_im:(637+OR+639+OR+634) > >>>>>> it appears to produce the correct results. But... that doesn't seem >
Ranking based on number of matches in a multivalued field?
So suppose I have a multivalued field for categories. Let's say we have 3 items with these categories: Item 1: category ids [1,2,5,7,9] Item 2: category ids [4,8,9] Item 3: category ids [1,4,9] I now run a filter query for any of the following category ids [1,4,9]. I should get all of them back as results because they all include at least one category which I'm querying. Now, how do I order it based on the number of matching categories?? In this case, I would like Item 3 (matched all [1,4,9]) to be ranked higher, followed by Item 2 (matched [4,9]) and Item 3 (matches [1,9]). Is there a way I can boost documents based on the number of matches? I don't want an "absolute" rank where Item 3 is definitely the first result, but rather a way to boost Item 3's score higher than that of Item 1 and 2 so that it's more likely to show up higher (depending on the query string). Thanks! -- Steven Ou | 歐偉凡 *ravn.com* | Chief Technology Officer steve...@gmail.com | +1 909-569-9880
Random + Boost?
Hey guys, This might seem odd, but is it possible to use boost with random ordering? That is, documents that get boosted are more likely to appear towards the top of the ordering (I only display page 1, say 30 documents). Does that make sense? I'm assuming that random ordering is, well, really random - so then it's not possible. But I figured I'd ask. My problem is that I want to display a random assortment of documents, but unfortunately certain types of documents far outnumber other types. So a "random" assortment ends up with 50% type A, 50% type B, C, D, E, F. So, I was thinking I would essentially "boost" types B, C, D, E, F until all types are approximately evenly represented in the random assortment. (Or alternatively, if the user has an affinity for type B documents, further boost type B documents so that they're more likely to be represented than other types). Anyone know if there's a way to do something like this in Solr? Much appreciated. Thanks. -- Steven Ou | 歐偉凡 *ravn.com* | Chief Technology Officer steve...@gmail.com | +1 909-569-9880
Re: Random + Boost?
Thank you for the response! I'm learning much about Solr... So I think FieldCollapsing might do the trick... So if I understand correctly, I should be able to group by type A, B, C, D, E, F, sort groups randomly, sort within groups randomly, display simple format, and get an evenly distributed set of results across A, B, C, D, E, F... But I'm not sure it's exactly what I need: - If I have, in this case, 6 document types, how do I return 25 documents? From what I understand, I need to set how many groups (let's say all 6) * how many documents per group (closest would be 4) = 24 documents. Would I simply need to return more documents and just process the first 25? - Also, this appears to me to return *exactly* evenly distributed results. How do I: - Make certain types a little more likely to appear, or - If, suppose, I have only 2 documents in type F and I query for all 6 groups, at 5 documents per group (for a total of 30 documents), will the fact that type F only has 2 documents result in a query that only returns 27 documents? If so, I would want to select the missing 3 documents evenly from the other 5 types. As for RandomSortField + function queries... I'm not sure I understand how I can use that to achieve what I need :-/ -- Steven Ou | 歐偉凡 *ravn.com* | Chief Technology Officer steve...@gmail.com | +1 909-569-9880 On Tue, Aug 16, 2011 at 12:00 PM, Ahmet Arslan wrote: > > This might seem odd, but is it possible to use boost with > > random ordering? > > That is, documents that get boosted are more likely to > > appear towards the > > top of the ordering (I only display page 1, say 30 > > documents). Does that > > make sense? I'm assuming that random ordering is, well, > > really random - so > > then it's not possible. But I figured I'd ask. > > > > My problem is that I want to display a random assortment of > > documents, but > > unfortunately certain types of documents far outnumber > > other types. So a > > "random" assortment ends up with 50% type A, 50% type B, C, > > D, E, F. So, I > > was thinking I would essentially "boost" types B, C, D, E, > > F until all types > > are approximately evenly represented in the random > > assortment. (Or > > alternatively, if the user has an affinity for type B > > documents, further > > boost type B documents so that they're more likely to be > > represented than > > other types). > > > > Anyone know if there's a way to do something like this in > > Solr? > > Sounds like you want to achieve diversity of results. > > Consider using http://wiki.apache.org/solr/FieldCollapsing > > Alternatively you can make use of RandomSortField with function queries. > > http://lucene.apache.org/solr/api/org/apache/solr/schema/RandomSortField.html >