I believe the index just contains information about single terms. A
PhraseQuery then searches the index for the parts of the phrase and
returns the hit information.
So, as far as I understand, there is no way to get the frequency of
phrase directly from an index, but you could create a PhraseQuery, and
use an IndexSearcher to return the Hits. That will provide only weighted
hit scores, which does not sound like what you want.
This may be similar to a question I posted back on June 16th. Paul
Elschot was kind enough to give me feedback. Search for that in the
archives, or try this link:
http://mail-archives.apache.org/mod_mbox/lucene-java-user/200506.mbox/[EMAIL
PROTECTED]
In summary, he suggests modify (extend?) PhraseQuery and
ExactPhraseScorer. I have gotten sidelined on trying to get character
positions for hits, so have not completed his suggested implementation.
If I do, I would be happy to share.
Good luck, and feel free to post anything you think might be helpful if
you implement something.
Sean
Fabio Cristiano dos Anjos wrote:
Hi,
How can I get phrase frequency in an index?
Thanks in advance!!
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]