Re: Wild card search not working

2015-11-30 Thread Douglas Kunzma
All - My document has multiple occurrences of the word quartz, but using totalTermFrequency summing for all terms appears to be working. Is this correct? If so thanks for your help. I was really stuck. I owe everyone a beer! Doug On Mon, Nov 30, 2015 at 7:42 AM, Allison, Timothy B. wrote: >

RE: Wild card search not working

2015-11-30 Thread Allison, Timothy B.
I'm getting this (with a single document that contains the word 'quartz': Term freq(indexReader.totalTermFreq(term))=0 Term freq(indexReader.getSumTotalTermFreq("Doc"))=1 totalHits = 1 termStatics=0 Is this what you're getting? So...the search is working, but the term counts aren't returning wh

RE: Wild card search not working

2015-11-30 Thread Allison, Timothy B.
If you want to find the matching terms, you have to do something like this: Query rewritten = spanTerm.rewrite(indexReader); Weight w = rewritten.createWeight(isearcher, false); Set terms = new HashSet<>(); w.extractTerms(terms); for (Ter

Wild card search not working

2015-11-30 Thread Douglas Kunzma
Hi - I've created a test program where I've been struggling with for a couple of days trying to get wild card searches working in Lucene. I have some Solr experience but this is the first time that I'm working with Lucene. I've copied the entire program to github here: luceneseach2

Re: Determine whether a MatchAllQuery or a Query with atleast one Term

2015-11-30 Thread Alan Woodward
Could you rewrite the query into a searcher-specific Weight, and then call extractTerms()? ie, do: Weight w = searcher.createNormalizedWeight(query, true); Set terms = new HashSet<>(); w.extractTerms(terms); if (terms.size() > 0) doStuff(); Alan Woodward www.flax.co.uk On 30 Nov 20