Java – hibernate search, Lucene or any other option?

I have a query to do Ilike on the size of string or text field (500000) in Table 11, but Ilike is obviously too large, and the search query takes 20 seconds The database is Postgres 8.4

I need to implement this search much faster

What came to mind:

>I combined another TVector column from all the columns to be searched and created a full-text index on it Full text search is very fast But... I can't map this TVector type to my In hbms So the idea fell down (I thought of it as a temporary solution anyway)@ H_ 404_ 7 @ > dormant search (first heard today) seems promising, but I need experienced opinions, because I don't want to enter the new API. It may not be the simplest API, but it can be made simpler@ H_ 404_ 7@Lucene

Anyway, this table has happened now, but I hope the solution is more general and applicable to future cases related to full-text search

All comments are appreciated!

Thank you list

Solution

I strongly suggest that hibernate search provides a very simple bridge between hibernate and Lucene Memoreber you will use here You only need to comment on the properties of the domain class you want to be able to search Then, when you update / insert / delete hibernate search enabled entities, you only need to update the relevant index This only happens when the transaction with database changes is committed, that is, if it is rolled back, the index will not be destroyed

So answer your question:

Yes, you can index specific columns on specific tables You can also verify the contents of the field so that you can match in the part of the field. > It's not hard to use at all. You just need to find the attributes you want to search Tell hibernate where to keep its index You can then use the entitymanager / session interface to load the entities you are searching for

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>