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

Solr4 join support #88

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Conversation

rlskoeser
Copy link
Contributor

Support for Solr 4 join queries based on the examples at http://wiki.apache.org/solr/Join

I added the join logic based on how range queries are handled in the LuceneQuery class.

I added some test cases and documentation. I wasn't sure how to test the error handling (e.g. attempting to join on fields not defined in the schema) as I couldn't find any tests that were similar enough to adapt.

I haven't used join queries very extensively yet, so it's entirely possible I'm assuming something I shouldn't or oversimplifying, but this code does successfully generate working join queries against actual my data.

As far as I can tell, the join query syntax only allows for one associated search term, but the code I added doesn't currently enforce this. If more than one search term is added to the join they will be added to the query but not given the context of the join. Should it not allow more than one term? Or perhaps it could automatically generate separate join requests if there are multiple terms - this way calling code wouldn't have to call join method repeatedly for multiple filters on the same join.

FYI, it looks like my editor settings have stripped out some whitespace and introduced some changes that aren't entirely relevant. My apologies for that, let me know if you want me to do something about it.

@rlskoeser
Copy link
Contributor Author

Updated pull request with a fix for join queries when combined with other searches. Also added join logic to a few other places I missed (nonzero check, etc).

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

Successfully merging this pull request may close these issues.

1 participant