Re: Auto-suggest internal terms

2010-06-03 Thread Michael Kuhlmann
The only solution without doing any custom work would be to perform a
normal query for each suggestion. But you might get into performance
troubles with that, because suggestions are typically performed much
more often than complete searches.

The much faster solution that needs own work would be to build up a
large TreeMap with each word as the keys, and the matching terms as the
values.

-Michael

Am 02.06.2010 22:01, schrieb Jay Hill:
 I've got a situation where I'm looking to build an auto-suggest where any
 term entered will lead to suggestions. For example, if I type wine I want
 to see suggestions like this:
 
 french *wine* classes
 *wine* book discounts
 burgundy *wine*
 
 etc.
 
 I've tried some tricks with shingles, but the only solution that worked was
 pre-processing my queries into a core in all variations.
 
 Anyone know any tricks to accomplish this in Solr without doing any custom
 work?
 
 -Jay
 


Re: Auto-suggest internal terms

2010-06-03 Thread Andrzej Bialecki
On 2010-06-03 09:56, Michael Kuhlmann wrote:
 The only solution without doing any custom work would be to perform a
 normal query for each suggestion. But you might get into performance
 troubles with that, because suggestions are typically performed much
 more often than complete searches.

Actually, that's not a bad idea - if you can trim the size of the index
(either by using shingles instead of docs, or trimming the main index -
LUCENE-1812) so that the index fits completely in RAM, and deploy this
index in a separate JVM (to benefit from other CPUs than the one that
runs your Solr core) or another machine, then I think performance would
not be a big concern, and the functionality would be just what you wanted.

 
 The much faster solution that needs own work would be to build up a
 large TreeMap with each word as the keys, and the matching terms as the
 values.

That would consume an awful lot of RAM... see SOLR-1316 for some
measurements.


-- 
Best regards,
Andrzej Bialecki 
 ___. ___ ___ ___ _ _   __
[__ || __|__/|__||\/|  Information Retrieval, Semantic Web
___|||__||  \|  ||  |  Embedded Unix, System Integration
http://www.sigram.com  Contact: info at sigram dot com



Re: Auto-suggest internal terms

2010-06-03 Thread Michael Kuhlmann
Am 03.06.2010 13:02, schrieb Andrzej Bialecki:
 ..., and deploy this
 index in a separate JVM (to benefit from other CPUs than the one that
 runs your Solr core)

Every known webserver ist multithreaded by default, so putting different
Solr instances into different JVMs will be of no use.

-Michael


Re: Auto-suggest internal terms

2010-06-03 Thread Andrzej Bialecki
On 2010-06-03 13:38, Michael Kuhlmann wrote:
 Am 03.06.2010 13:02, schrieb Andrzej Bialecki:
 ..., and deploy this
 index in a separate JVM (to benefit from other CPUs than the one that
 runs your Solr core)
 
 Every known webserver ist multithreaded by default, so putting different
 Solr instances into different JVMs will be of no use.


You are right to a certain degree. Still, there are some contention
points in Lucene/Solr, how threads are allocated on available CPU-s, and
how the heap is used, which can make a two-JVM setup perform much better
than a single-JVM setup given the same number of threads...


-- 
Best regards,
Andrzej Bialecki 
 ___. ___ ___ ___ _ _   __
[__ || __|__/|__||\/|  Information Retrieval, Semantic Web
___|||__||  \|  ||  |  Embedded Unix, System Integration
http://www.sigram.com  Contact: info at sigram dot com



Re: Auto-suggest internal terms

2010-06-03 Thread Michael Kuhlmann
Am 03.06.2010 16:45, schrieb Andrzej Bialecki:
 You are right to a certain degree. Still, there are some contention
 points in Lucene/Solr, how threads are allocated on available CPU-s, and
 how the heap is used, which can make a two-JVM setup perform much better
 than a single-JVM setup given the same number of threads...

Allow me to don't belive this! ;-) It's not Solr that allocates threads,
it's the web server (Jetty, Glassfish, or whatever). In a normal
configuration, it will use as many threads as useful, so that there's no
need to start a second web server on the same machine.

To Lucene, there is some magic algorithm that reuses an IndexReader by a
limited number of threads (as far as I have seen in the code, but the
details are unimportant). But to the very least, if you've a multi core
setup, you'll get special IndexReader instances from Lucene per core. So
I don't see why you should scatter them on different VMs.

Greetings,
Michael


Auto-suggest internal terms

2010-06-02 Thread Jay Hill
I've got a situation where I'm looking to build an auto-suggest where any
term entered will lead to suggestions. For example, if I type wine I want
to see suggestions like this:

french *wine* classes
*wine* book discounts
burgundy *wine*

etc.

I've tried some tricks with shingles, but the only solution that worked was
pre-processing my queries into a core in all variations.

Anyone know any tricks to accomplish this in Solr without doing any custom
work?

-Jay


RE: Auto-suggest internal terms

2010-06-02 Thread Patrick Wilson
I'm painfully new to Solr so please be gentle if my suggestion is terrible!

Could you use highlighting to do this? Take the first n results from a query 
and show their highlights, customizing the highlights to show the desired 
number of words.

Just a thought.

Patrick

-Original Message-
From: Jay Hill [mailto:jayallenh...@gmail.com]
Sent: Wednesday, June 02, 2010 4:02 PM
To: solr-user@lucene.apache.org
Subject: Auto-suggest internal terms

I've got a situation where I'm looking to build an auto-suggest where any
term entered will lead to suggestions. For example, if I type wine I want
to see suggestions like this:

french *wine* classes
*wine* book discounts
burgundy *wine*

etc.

I've tried some tricks with shingles, but the only solution that worked was
pre-processing my queries into a core in all variations.

Anyone know any tricks to accomplish this in Solr without doing any custom
work?

-Jay


RE: Auto-suggest internal terms

2010-06-02 Thread Tim Gilbert
I was interested in the same thing and stumbled upon this article:

http://www.mattweber.org/2009/05/02/solr-autosuggest-with-termscomponent
-and-jquery/

I haven't followed through, but it looked promising to me.

Tim

-Original Message-
From: Jay Hill [mailto:jayallenh...@gmail.com] 
Sent: Wednesday, June 02, 2010 4:02 PM
To: solr-user@lucene.apache.org
Subject: Auto-suggest internal terms

I've got a situation where I'm looking to build an auto-suggest where
any
term entered will lead to suggestions. For example, if I type wine I
want
to see suggestions like this:

french *wine* classes
*wine* book discounts
burgundy *wine*

etc.

I've tried some tricks with shingles, but the only solution that worked
was
pre-processing my queries into a core in all variations.

Anyone know any tricks to accomplish this in Solr without doing any
custom
work?

-Jay