0

I am writing a prototype of a new app for an enterprise. I want to include a great search engine, which is something they have never had before. What I am looking for is something that can translate a lucene style query language into SQL statements on a key value pair data model. (three fields, grouping id, key, value)

Ive been looking for a while now and havn't had any luck. Im about to open the source for lucene and see if I can pull the query algorithms out and have them generate sql instead of index search commands. but im not very hopefull.

I can't just run lucene or any other indexing system on this enterprise for political and regulatory reasons so thats not an option.

Does this type of system exist?

1 Answer 1

1

see if I can pull the query algorithms out and have them generate sql instead

Don't waste your time. SQL and Lucene queries work in a completely different way; this is because they use different underlying data structures, algorithms, etc.

The best you can do is to write SQL query parser and rewrite those queries into Lucene queries. But you'd have to be naive to think you can write full-blown SQL query parser. You can easily solve simple cases, but what are you going to do when somebody sends you a JOIN? Or a GROUP BY bar HAVING foo>3?

If you can't jump over political hurdles, just use one of the full text indexing algorithms databases can offer; this is better than nothing.

Sign up to request clarification or add additional context in comments.

1 Comment

its daunting, i know. im reading the query parser code in lucene now, yea, this is going to a command style system it looks like. I was hoping i could translate that command style to sql. the end result i want is a majority of this lucenetutorial.com/lucene-query-syntax.html being translated to sql queries. But your right, it looks like the junits will be more helpful in that effort than the actual query builder code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.