English 中文(简体)
How to do SQL IN like query in hibernate search
原标题:

A simulating scenario is:

Search for books whose content contains "success" AND author is in a list of passed names(could be thousands of).

I looked into filter: http://docs.jboss.org/hibernate/stable/search/reference/en-US/html_single/#query-filter

Seams like hibernate search has no native support of this.

What is recommended approach for this problem? I think I am not alone.

Thanks for any inputs.

问题回答

Let me post my current solution.

Get the search results with minimal projections for the keywords, and loop through the results to get only matching ones from the IN list.

I am not using filter.

Open to other alternatives once convinced.

If you look here http://lucene.apache.org/java/2_4_1/queryparsersyntax.html (at the end "Field Grouping"), you can write a query with something like :

content:success AND author:("firstname" "secondname" "thirdname" ...)





相关问题
How do I reset or override IE CSS filters?

I m using the proprietry MS filter property to try and create a non ugly equivalent to css3 text-shadow and box-shadow; I was actually doing really well until I hit this problem. It looks like when ...

PHP filter string input, cut off all newlines, 1 chars

I m writing in PHP! There s a user string input, and I want to cut off all newlines,1 chars that are more than 1 in a row (avoid <br /><br />...). example: I am a SPaMmEr! would ...

The Fastest DataStructure to Filter with in C#

Currently we are filtering and sorting data with a datatable. /// <summary> /// Filters the data table and returns a new data table with only the filtered rows. /// </summary>...

How to dynamically update a ListView on Android [closed]

On Android, how can I a ListView that filters based on user input, where the items shown are updated dynamically based on the TextView value? I m looking for something like this: -------------------...

Handling no results for docmd.applyfilter

I have an Access app where I use search functionality. I have a TextBox and a Search Button on the form, and it does a wildcard search of whatever the user enters in the TextBox, and displays the ...

Best method to scale DropShadows in AS3?

I m creating a flash application that makes use of both the dropShadow filter and scaling of various sprites. And therein lies the problem: This filter supports Stage scaling. However, it does ...

热门标签