Reverse pattern search analyser


(Dj Gilcrease) #1

I am wondering if it is possible to create a "reverse" pattern search/query analyser where the pattern is stored in the field and the string to match against is the query

As an example

doc:
my_field_re: bla-[a-z0-9]+

query:
my_field_re: boo-test

nothing returned

query:
my_field_re: bla-test

doc returned

query:
my_field_re: bla-test-more

nothing returned


(Nik Everett) #2

Have a look at the groups parameter here. I think that is what you want.


(Christoph) #3

Hi,

this is probably possible with percolator api. You register your pattern as percolator queries (potentially with some metadata, then you percolate your docs containing the string to match against it. I think the only step missing is the "doc return" part, in the standard way you get back the Id of the percolate query. You probably need a second lookup fo the doc content by Id.


(Nik Everett) #4

Whoops! Sorry, I thought you wanted a different thing because I didn't read closely. Sorry!


(Dj Gilcrease) #5

Thank you, the percolator api looks very promising.


(system) #6