On 27.03.2006, at 22:45, Christoph Breidert wrote:
Christoph Breidert schrieb:
Hi folks,
I have a nice javascript (I will be happy to provide) for
autosuggestion of search terms.
For the search on my magnolia system I want to use this script to
display search terms, that actually deliver a hit from the index.
Therefore I need a method that lists all the search terms that
actually provide a hit.
I couldn't quite figure out how this can be done and would be very
thankful for any hints.
I am using Magnolia 2.1
Thx, Christoph
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------
Hello folks,
I will answer my own question, which was "how to retrieve all
search terms that deliver a hit in magnolia search". From looking
at the JCR API you cannot list the search terms that actually
deliver a hit.
However, in the jackrabbit-implementation of the JCR, internally a
lucene index is used. The API of lucene does have this
functionality. So, what I do is manually open the index and list
all tokens for the indexed field "title" and "fulltext".
I am not sure whether this is a smart/elegant way to achieve this.
I would have liked to discuss this with some of the users/
developers out there, but unfortunately nobody bothered replying to
my question.
At the very least you should probably abstract from the underlying
lucene implementation. Magnolia is explicitly built in such a way
that you can switch between repository implementations. Other
implementations will have a different way of storing indexes, so I
guess you could have somithing like a plugable key word provider and
provide a simple implementation for jackrabbit / lucene. Others could
then add implementations for other indexers / repositories.
Besides that, I am sure what you did is useful and cool! Now make
this an extension of the simple search tag using AJAX and everybody
will have a big smile on her face ;-)
- Boris
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------