Can I combine fuzzy and proximity searches in Apache Lucene's standard syntax?
Asked Answered
G

0

11

I am searching a codebase indexed by OpenGrok, the -a option has been enabled to allow the first character of a search term to be a wildcard. I would like to find all occurrences of method foo that take some string parameter (foo("") with one or more characters in the string) and the method is within 5 words of variable bar.


With the breakup of words provided by the standard tokenizer I can use +full:"foo bar"~5 to get all foo( near bar, but excluding the parameterless methods is a problem because (" is indexed as two whitespace characters, so for example foo("jar") seems to match foo AND \ \ AND jar AND \ \". The syntax doesn't look like it supports a search for this combination (even without the wildcard string rather than "jar") with a ""~5 proximity search. Any ideas on how to achieve all or part of this, given that changing the tokenizer is not an option at the moment?

Gasteropod answered 31/8, 2012 at 8:18 Comment(3)
are you only able to construct queries as a query string and not programmatically?Montserrat
did you ever get an answer to this @MilesHampson?Pongee
From my search, it seems like this is impossible.Filide

© 2022 - 2024 — McMap. All rights reserved.