On Fri, Aug 19, 2011 at 6:26 PM, Michael Ryan <mr...@moreover.com> wrote: > Is there a way to specify in a query that a term must match at least X times > in a document, where X is some value greater than 1? >
One simple way of doing this is maybe to write a wrapper for TermQuery that only returns docs with a Term Frequency > X as far as I understand the question those terms don't have to be within a certain window right? simon > For example, I want to only get documents that contain the word "dog" three > times. I've thought that using a proximity query with an arbitrary large > distance value might do it: > "dog dog dog"~100000 > And that does seem to return the results I expect. > > But when I try for more than three, I start getting unexpected result counts > as I change the proximity value: > "dog dog dog dog"~100000 returns 6403 results > "dog dog dog dog"~200000 returns 9291 results > "dog dog dog dog"~300000 returns 6395 results > > Anyone ever do something like this and know how I can accomplish this? > > -Michael >