Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand Search::Query to "auto-correct" #1

Closed
clintongormley opened this issue Aug 10, 2012 · 6 comments
Closed

Expand Search::Query to "auto-correct" #1

clintongormley opened this issue Aug 10, 2012 · 6 comments

Comments

@clintongormley
Copy link

Hi Peter

Search::Query looks interesting. I wrote something related for ElasticSearch: https://metacpan.org/module/ElasticSearch::QueryParser.

One of the reasons for writing it was that ElasticSearch throws an error if the search string is malformed, eg (foo. By default, my module tries to fix up the query to be "legal", but it's not as flexible etc as it should be.

If you were to expand Search::Query to do something similar, I'd prefer to ditch my module and replace it with yours. What do you think?

clint

@pkarman
Copy link
Collaborator

pkarman commented Aug 10, 2012

Hi Clint,

I'd be happy to work with you on getting an ElasticSearch Dialect into Search::Query. It's been on my todo list.

Does the 'sloppy' param option to Parser->new() do approximately what you're after?

https://metacpan.org/module/Search::Query::Parser#new

@clintongormley
Copy link
Author

Hi Peter

thanks for responding.

I'd be happy to work with you on getting an ElasticSearch Dialect into
Search::Query. It's been on my todo list.

And I'd be more than happy to help you with that. I don't know how well
you know ES, so any questions, just ask. Also, I'm on #elasticsearch on
irc.perl.org if you want to chat live.

Does the 'sloppy' param option to Parser->new() do approximately what
you're after?

Oh I hadn't seen that. That's good. QueryParser goes a bit further - it
tries to repair any errors that it can (eg closing any open parentheses
on the stack, etc).

Also, it gives the user some control over what is allowed in the query
string, eg you can search fields foo and bar, but not baz.

The various syntaxes you support may already do that - I haven't had a
chance to look at your code in any detail (apologies - been a hell of a
day).

clint

@karpet
Copy link
Owner

karpet commented Aug 11, 2012

You can whitelist supported fields in the Parser->new constructor.

I added a 'fixup' feature here:
3dc4043

Let me know if that does what you had in mind.

@clintongormley
Copy link
Author

Hiya Peter

On Sat, 2012-08-11 at 10:27 -0700, Peter Karman wrote:

You can whitelist supported fields in the Parser->new constructor.

I added a 'fixup' feature here:
3dc4043

Great

Let me know if that does what you had in mind.

I apologise for having opened this issue at a moment when I've got so
much on that I can't give it the attention it deserves.

I'll be able to come back to this in September - marked in my diary :)

thanks

clint

@karpet
Copy link
Owner

karpet commented Aug 13, 2012

Clinton Gormley wrote on 8/13/12 2:02 AM:

I apologise for having opened this issue at a moment when I've got so
much on that I can't give it the attention it deserves.

I'll be able to come back to this in September - marked in my diary :)

No worries - sounds good.

Peter Karman . http://peknet.com/ . peter@peknet.com

@karpet
Copy link
Owner

karpet commented Feb 19, 2013

0.22 was just pushed to CPAN with the 'fixup' feature.

@karpet karpet closed this as completed Feb 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants