Let's refine this...
If a top suggestion is X, do you simply want to know a few of the documents
which have the highest term frequency for X?
Or is there some other term-oriented metric you might propose?
-- Jack Krupansky
-----Original Message-----
From: Bratislav Stojanovic
Sent: Thursday, March 14, 2013 6:14 PM
To: java-user@lucene.apache.org
Subject: Re: Getting documents from suggestions
Wow that was fast :)
I have implemented a simple search box with auto-suggestions, so whenever
user
types in something, ajax call is fired to the SuggestServlet and in return
10 suggestions
are shown. It's working fine with the SpellChecker class, but I only get
array of Strings.
What I want is to get lucene Document instances so I can use doc.get("id")
to filter those suggestions.
This field is my field, doesn't have to do anything with the default Doc.
Id field Lucene generates.
Here's an example : when I type "apache" I get suggestions like
"apache.org",
"apache2" etc.
Now I want to have something like this :
Document doc = SomeClass.getDocFromSuggestion("apache.org");
if (doc.get("id") == ...) {
//add suggestion into the result
} else {
//do nothing.
}
Is MoreLikeThis designed for this?
On Thu, Mar 14, 2013 at 10:45 PM, Jack Krupansky
<j...@basetechnology.com>wrote:
Could you give us some examples of what you expect? I mean, how is your
suggested set of documents any different from simply executing a query
with
the list of suggested terms (using q.op=OR)?
Or, maybe you want something like MoreLikeThis?
-- Jack Krupansky
-----Original Message----- From: Bratislav Stojanovic
Sent: Thursday, March 14, 2013 5:36 PM
To: java-user@lucene.apache.org
Subject: Getting documents from suggestions
Hi all,
How can I filter suggestions based on some value from the indexed field?
I have a stored 'id' field in my index and I want to use that to examine
documents
where the suggestion was found, but how to get Document from suggestion?
SpellChecker class only returns array of strings.
What classes should I use? Please help.
Thanx in advance.
--
Bratislav Stojanovic, M.Sc.
------------------------------**------------------------------**---------
To unsubscribe, e-mail:
java-user-unsubscribe@lucene.**apache.org<java-user-unsubscr...@lucene.apache.org>
For additional commands, e-mail:
java-user-help@lucene.apache.**org<java-user-h...@lucene.apache.org>
--
Bratislav Stojanovic, M.Sc.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org