medic / lucene-query-generator

Generate escaped lucene query strings
Apache License 2.0
16 stars 7 forks source link

added support for partial search with test #6

Closed parthgandhi7 closed 8 years ago

parthgandhi7 commented 8 years ago

This allows partial search functionality. Like if we search for 'name: che*', we should get all the results containing cheese, chess etc. Added noFormatflag for by passing the string conversion as for the partial search to work, the key value pair should go as it is without any double quotes around the value.

garethbowen commented 8 years ago

Hi @parthgandhi7 . Thanks for the PR and this is definitely a good idea. This was discussed in https://github.com/medic/lucene-query-generator/pull/3 too. I think the api I prefer is being able to pass a string or an object for schema type, so you could say name: { type: 'string', allowSpecialCharacters: true }. This makes sense to me because the field type is still a string - it's adding a separate flag to disable the escaping.

Would that work for you?

If you have time to update this PR with that format that'd be great. If not, I'll try to get on to it next week.

garethbowen commented 8 years ago

Merged in https://github.com/medic/lucene-query-generator/pull/7