Query Response Doc Score -> Int Value

2008-11-17 Thread Derek Springer
Hello,
I am currently performing a query to a Solr index I've set up and I'm trying
to 1) sort on the score and 2) sort on the date_created (a custom field I've
added). The sort command looks like: sort=score+desc,created_date+desc.

The gist of it is that I will 1) first return the most relevant results then
2) within those results, return the most recent results. However, the issue
I have is that the score is a decimal value that is far to precise (e.g.
2.3518934 vs 2.2173865) and will therefore never "collide" and trigger the
secondary sort on the date.

The question I am asking is if anyone knows a way to produce a score that is
more coarse, or if it is possible to force the score to return as an
integer. That way I could have the results collide on the score more often
and therefore sort on the date as well.

Thanks!
-Derek


Re: Query Response Doc Score -> Int Value

2008-11-17 Thread Derek Springer
Thanks for the heads up. Can anyone point me to (or provide me with) an
example of writing a function query?

-Derek

On Mon, Nov 17, 2008 at 8:17 PM, Yonik Seeley <[EMAIL PROTECTED]> wrote:

> A function query is the likely candidate - no such quantization
> function exists, but it would be relatively easy to write one.
>
> -Yonik
>
> On Mon, Nov 17, 2008 at 8:17 PM, Derek Springer <[EMAIL PROTECTED]> wrote:
> > Hello,
> > I am currently performing a query to a Solr index I've set up and I'm
> trying
> > to 1) sort on the score and 2) sort on the date_created (a custom field
> I've
> > added). The sort command looks like: sort=score+desc,created_date+desc.
> >
> > The gist of it is that I will 1) first return the most relevant results
> then
> > 2) within those results, return the most recent results. However, the
> issue
> > I have is that the score is a decimal value that is far to precise (e.g.
> > 2.3518934 vs 2.2173865) and will therefore never "collide" and trigger
> the
> > secondary sort on the date.
> >
> > The question I am asking is if anyone knows a way to produce a score that
> is
> > more coarse, or if it is possible to force the score to return as an
> > integer. That way I could have the results collide on the score more
> often
> > and therefore sort on the date as well.
> >
> > Thanks!
> > -Derek
> >
>



-- 
Derek B. Springer
Software Developer
Mahalo.com, Inc.
902 Colorado Ave.,
Santa Monica, CA 90401
[EMAIL PROTECTED]


Re: Query Response Doc Score -> Int Value

2008-11-18 Thread Derek Springer
Better yet, does anyone know where the method that writes the score lives?
For instance, a getScore() method that writes the score out that I could
override and truncate? Thanks!

-Derek

On Mon, Nov 17, 2008 at 9:59 PM, Derek Springer <[EMAIL PROTECTED]> wrote:

> Thanks for the heads up. Can anyone point me to (or provide me with) an
> example of writing a function query?
>
> -Derek
>
>
> On Mon, Nov 17, 2008 at 8:17 PM, Yonik Seeley <[EMAIL PROTECTED]> wrote:
>
>> A function query is the likely candidate - no such quantization
>> function exists, but it would be relatively easy to write one.
>>
>> -Yonik
>>
>> On Mon, Nov 17, 2008 at 8:17 PM, Derek Springer <[EMAIL PROTECTED]> wrote:
>> > Hello,
>> > I am currently performing a query to a Solr index I've set up and I'm
>> trying
>> > to 1) sort on the score and 2) sort on the date_created (a custom field
>> I've
>> > added). The sort command looks like: sort=score+desc,created_date+desc.
>> >
>> > The gist of it is that I will 1) first return the most relevant results
>> then
>> > 2) within those results, return the most recent results. However, the
>> issue
>> > I have is that the score is a decimal value that is far to precise (e.g.
>> > 2.3518934 vs 2.2173865) and will therefore never "collide" and trigger
>> the
>> > secondary sort on the date.
>> >
>> > The question I am asking is if anyone knows a way to produce a score
>> that is
>> > more coarse, or if it is possible to force the score to return as an
>> > integer. That way I could have the results collide on the score more
>> often
>> > and therefore sort on the date as well.
>> >
>> > Thanks!
>> > -Derek
>> >
>>
>
>
>
> --
> Derek B. Springer
> Software Developer
> Mahalo.com, Inc.
> 902 Colorado Ave.,
> Santa Monica, CA 90401
> [EMAIL PROTECTED]
>



-- 
Derek B. Springer
Software Developer
Mahalo.com, Inc.
902 Colorado Ave.,
Santa Monica, CA 90401
[EMAIL PROTECTED]


Please help me articulate this query

2008-12-15 Thread Derek Springer
Hey all,
I'm having trouble articulating a query and I'm hopeful someone out there
can help me out :)

My situation is this: I am indexing a series of questions that can either be
asked from a main question entry page, or a specific subject page. I have a
field called "referring" which indexes the title of the specific subject
page, plus the regular question whenever that document is submitted from a
specific specific subject page. Otherwise, every document is indexed with
just the question.

Specifically, what I am trying to do is when I am on the page specific
subject page (e.g. Tom Cruise) I want to search for all of the questions
asked from that page, plus any question asked about Tom Cruise. Something
like:
q=(referring:Tom AND Cruise) OR (question:Tom AND Cruise)

"Have you ever used a Tom Tom?" - Not returned
"Where is the best place to take a cruise?" - Not returned
"When did he have is first kid?" - Returned iff question was asked from Tom
Cruise page
"Do you think that Tom Cruise will make more movies?" - Always returned

Any thoughts?

-Derek


Re: Please help me articulate this query

2008-12-15 Thread Derek Springer
Thanks for the tip, I appreciate it!

However, does anyone know how to articulate the syntax of "(This AND That)
OR (Something AND Else)" into a query string?

i.e. q=referring:### AND question:###

On Mon, Dec 15, 2008 at 12:32 PM, Stephen Weiss wrote:

> I think in this case you would want to index each question with the
> possible referrers ( by title might be too imprecise, I'd go with filename
> or ID) and then do a search like this (assuming in this case it's by
> filename)
>
> q=(referring:TomCruise.html) OR (question: Tom AND Cruise)
>
> Which seems to be what you're thinking.
>
> I would make the referrer a type "string" though so that you don't
> accidentally pull in documents from a different subject (Tom Cruise this
> would work ok, but imagine you need to distinguish between George Washington
> and George Washington Carver).
>
> --
> Steve
>
>
>
> On Dec 15, 2008, at 2:59 PM, Derek Springer wrote:
>
>  Hey all,
>> I'm having trouble articulating a query and I'm hopeful someone out there
>> can help me out :)
>>
>> My situation is this: I am indexing a series of questions that can either
>> be
>> asked from a main question entry page, or a specific subject page. I have
>> a
>> field called "referring" which indexes the title of the specific subject
>> page, plus the regular question whenever that document is submitted from a
>> specific specific subject page. Otherwise, every document is indexed with
>> just the question.
>>
>> Specifically, what I am trying to do is when I am on the page specific
>> subject page (e.g. Tom Cruise) I want to search for all of the questions
>> asked from that page, plus any question asked about Tom Cruise. Something
>> like:
>> q=(referring:Tom AND Cruise) OR (question:Tom AND Cruise)
>>
>> "Have you ever used a Tom Tom?" - Not returned
>> "Where is the best place to take a cruise?" - Not returned
>> "When did he have is first kid?" - Returned iff question was asked from
>> Tom
>> Cruise page
>> "Do you think that Tom Cruise will make more movies?" - Always returned
>>
>> Any thoughts?
>>
>> -Derek
>>
>
>


Re: Please help me articulate this query

2008-12-16 Thread Derek Springer
Excellent, thank you! :)

-Derek

On Mon, Dec 15, 2008 at 8:45 PM, Otis Gospodnetic <
otis_gospodne...@yahoo.com> wrote:

> Derek,
>
> q=+referring:XXX +question:YYY
>
>
> (of course, you'll have to URL-encode that query string0
>
> Otis
> --
> Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch
>
>
>
> - Original Message 
> > From: Derek Springer 
> > To: solr-user@lucene.apache.org
> > Sent: Monday, December 15, 2008 3:40:55 PM
> > Subject: Re: Please help me articulate this query
> >
> > Thanks for the tip, I appreciate it!
> >
> > However, does anyone know how to articulate the syntax of "(This AND
> That)
> > OR (Something AND Else)" into a query string?
> >
> > i.e. q=referring:### AND question:###
> >
> > On Mon, Dec 15, 2008 at 12:32 PM, Stephen Weiss wrote:
> >
> > > I think in this case you would want to index each question with the
> > > possible referrers ( by title might be too imprecise, I'd go with
> filename
> > > or ID) and then do a search like this (assuming in this case it's by
> > > filename)
> > >
> > > q=(referring:TomCruise.html) OR (question: Tom AND Cruise)
> > >
> > > Which seems to be what you're thinking.
> > >
> > > I would make the referrer a type "string" though so that you don't
> > > accidentally pull in documents from a different subject (Tom Cruise
> this
> > > would work ok, but imagine you need to distinguish between George
> Washington
> > > and George Washington Carver).
> > >
> > > --
> > > Steve
> > >
> > >
> > >
> > > On Dec 15, 2008, at 2:59 PM, Derek Springer wrote:
> > >
> > >  Hey all,
> > >> I'm having trouble articulating a query and I'm hopeful someone out
> there
> > >> can help me out :)
> > >>
> > >> My situation is this: I am indexing a series of questions that can
> either
> > >> be
> > >> asked from a main question entry page, or a specific subject page. I
> have
> > >> a
> > >> field called "referring" which indexes the title of the specific
> subject
> > >> page, plus the regular question whenever that document is submitted
> from a
> > >> specific specific subject page. Otherwise, every document is indexed
> with
> > >> just the question.
> > >>
> > >> Specifically, what I am trying to do is when I am on the page specific
> > >> subject page (e.g. Tom Cruise) I want to search for all of the
> questions
> > >> asked from that page, plus any question asked about Tom Cruise.
> Something
> > >> like:
> > >> q=(referring:Tom AND Cruise) OR (question:Tom AND Cruise)
> > >>
> > >> "Have you ever used a Tom Tom?" - Not returned
> > >> "Where is the best place to take a cruise?" - Not returned
> > >> "When did he have is first kid?" - Returned iff question was asked
> from
> > >> Tom
> > >> Cruise page
> > >> "Do you think that Tom Cruise will make more movies?" - Always
> returned
> > >>
> > >> Any thoughts?
> > >>
> > >> -Derek
> > >>
> > >
> > >
>
>


500 Errors on update

2009-02-02 Thread Derek Springer
Hi all,
I recently created a Solr index to track some news articles that I follow
and I've noticed that I occasionally receive 500 errors when posting an
update. It doesn't happen every time and I can't seem to reproduce the
error. I should mention that I have another Solr index setup under the same
instance (configured via solr.xml) and I do not seem to be having the same
issue. Also, I can query the index without issue.

Does anyone know if this is an error with the Tomcat server I have set up,
or an issue with Solr itself? Has anyone else experienced a similar issue?

If it's any help, here's a dump of the xml that caused an error:

Pinging Solr Error: HTTP Error 500: Internal Server Error

  
'The day the music died'? Hardly

http://rss.cnn.com/~r/rss/cnn_showbiz/~3/JBV2Hu7Pisg/index.html

The plane crash that killed Buddy
Holly, Ritchie Valens and The Big Bopper has echoed through rock 'n' roll
history for 50 years, representing, if not the end of rock 'n' roll itself,
the close of an era. On Monday night, the  anniversary of the trio's deaths,
a huge tribute concert is taking place.
2009-02-02T15:43:54Z
www.cnn.com
  

  
'867-5309' number for sale on
eBay

http://rss.cnn.com/~r/rss/cnn_showbiz/~3/rxehPnDAe7Y/index.html

Jenny's phone number is for sale, but
not for a song.
2009-02-02T18:53:42Z
www.cnn.com
  

  
Porn airs during Super Bowl

http://rss.cnn.com/~r/rss/cnn_showbiz/~3/pCTDvXLkyb4/index.html

Super Bowl fans in Tucson, Arizona,
caught a different kind of show during Sunday's big game.
2009-02-02T17:34:43Z
www.cnn.com
  

  
Gallery: Hayden Panettiere at the big
game

http://rss.cnn.com/~r/rss/cnn_showbiz/~3/cygh8gfbXR0/index.html

Gallery: Hayden Panettiere at the big
game
2009-02-02T14:46:26Z
www.cnn.com
  

  
Former 'Homicide' star breaks
out

http://rss.cnn.com/~r/rss/cnn_showbiz/~3/Uxic4SVAHVo/index.html

As the critics rave and the
nominations flow in for her latest role in "Frozen River," Melissa Leo, a
veteran of the independent film scene and shows such as "Homicide," has
managed to stay grounded in her work as an actress.
2009-02-02T13:19:10Z
www.cnn.com
  

  
Don McLean: Buddy Holly was a
genius

http://rss.cnn.com/~r/rss/cnn_showbiz/~3/eBj6NfUFKzs/index.html

Of all the unique oddities of my
career, I am perhaps proudest of the fact that I am forever linked with
Buddy Holly.
2009-02-02T20:55:16Z
www.cnn.com
  

  
Sports attorney: Phelps could lose
endorsements

http://rss.cnn.com/~r/rss/cnn_showbiz/~3/px0QszfYZ3Y/index.html

Olympic gold medalist Michael Phelps
has acknowledged he engaged in "regrettable" behavior and "demonstrated bad
judgment," after a British newspaper published a photograph of the swimmer
using a marijuana pipe.
2009-02-02T19:21:10Z
www.cnn.com
  

  
'Taken' steals No. 1 slot at box
office

http://rss.cnn.com/~r/rss/cnn_showbiz/~3/fEoXK9HMowc/index.html

With an unexpectedly big gross of
$24.6 million, according to Sunday's early estimates, Liam Neeson's
kidnapping thriller "Taken" was the easy victor at the box office on this
Super Bowl weekend.
2009-02-01T20:50:14Z
www.cnn.com
  
  


Re: 500 Errors on update

2009-02-02 Thread Derek Springer
Der, certainly!

org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out:
SingleInstanceLock: write.lock
at org.apache.lucene.store.Lock.obtain(Lock.java:85)
at org.apache.lucene.index.IndexWriter.init(IndexWriter.java:1140)
at
org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:938)
at
org.apache.solr.update.SolrIndexWriter.<init>(SolrIndexWriter.java:116)
at
org.apache.solr.update.UpdateHandler.createMainIndexWriter(UpdateHandler.java:122)
at
org.apache.solr.update.DirectUpdateHandler2.openWriter(DirectUpdateHandler2.java:167)
at
org.apache.solr.update.DirectUpdateHandler2.addDoc(DirectUpdateHandler2.java:221)
at
org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpdateProcessorFactory.java:59)
at
org.apache.solr.handler.XmlUpdateRequestHandler.processUpdate(XmlUpdateRequestHandler.java:196)
at
org.apache.solr.handler.XmlUpdateRequestHandler.handleRequestBody(XmlUpdateRequestHandler.java:123)
at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1204)
at
org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:303)
at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:232)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
type Status
reportmessage Lock obtain timed out: SingleInstanceLock:
write.lock


On Mon, Feb 2, 2009 at 1:51 PM, Matthew Runo  wrote:

> Could you also provide us with the error you were getting?
>
> Thanks for your time!
>
> Matthew Runo
> Software Engineer, Zappos.com
> mr...@zappos.com - 702-943-7833
>
> On Feb 2, 2009, at 1:46 PM, Derek Springer wrote:
>
>  Hi all,
>> I recently created a Solr index to track some news articles that I follow
>> and I've noticed that I occasionally receive 500 errors when posting an
>> update. It doesn't happen every time and I can't seem to reproduce the
>> error. I should mention that I have another Solr index setup under the
>> same
>> instance (configured via solr.xml) and I do not seem to be having the same
>> issue. Also, I can query the index without issue.
>>
>> Does anyone know if this is an error with the Tomcat server I have set up,
>> or an issue with Solr itself? Has anyone else experienced a similar issue?
>>
>> If it's any help, here's a dump of the xml that caused an error:
>>
>> Pinging Solr Error: HTTP Error 500: Internal Server Error
>> 
>> 
>>   'The day the music died'? Hardly
>>   
>> http://rss.cnn.com/~r/rss/cnn_showbiz/~3/JBV2Hu7Pisg/index.html<http://rss.cnn.com/%7Er/rss/cnn_showbiz/%7E3/JBV2Hu7Pisg/index.html>
>> <http://rss.cnn.com/%7Er/rss/cnn_showbiz/%7E3/JBV2Hu7Pisg/index.html>
>> 
>>   The plane crash that killed Buddy
>> Holly, Ritchie Valens and The Big Bopper has echoed through rock 'n' roll
>> history for 50 years, representing, if not the end of rock 'n' roll
>> itself,
>> the close of an era. On Monday night, the  anniversary of the trio's
>> deaths,
>> a huge tribute concert is taking place.
>>   2009-02-02T15:43:54Z
>>   www.cnn.com
>> 
>>
>> 
>>   '867-5309' number for sale on
>> eBay
>>   
>> http://rss.cnn.com/~r/rss/cnn_showbiz/~3/rxehPnDAe7Y/index.html<http://rss.cnn.com/%7Er/rss/cnn_showbiz/%7E3/rxehPnDAe7Y/index.html>
>> <http://rss.cnn.com/%7Er/rss/cnn_showbiz/%7E3/rxehPnDAe7Y/index.html>
>> 
>>   Jenny's phone number is for sale, but
>> not for a song.
>>   2009-02-02T18:53