Turn off indexing in hibernate search
Asked Answered
I

2

6

I have hibernate search set-up and it's (re-)indexing my annotated entities up on commit just fine.

But I have a number of integration tests which have only partially initilzed data. Since this is throwing exceptions when hibernate search tries to index this objects, I'd prefer to completely switch off the indexing (or hibernate search) for this tests.

I already tried to not set hibernate.search.default.indexBase and hibernate.search.default.directory_provider for the tests. But this didn't help.

How can I switch off hibernate search indexing?

Incision answered 6/8, 2015 at 8:2 Comment(2)
have you set the hibernate.search.indexing_strategy to manual?Frondescence
That does the trick. Thanks! Feal free to add your comment as answer to get the credits.Incision
F
9

set the hibernate.search.indexing_strategy configuration property to manual

for further reference, feel free to check the documentation here.

Frondescence answered 6/8, 2015 at 8:58 Comment(0)
J
5

if you want to disable all hibernate search feature (for instance for a dev environment), you need to set these 2 options :

hibernate.search.autoregister_listeners = false
hibernate.search.indexing_strategy = manual

the second one only disable the "write" operations on indexes not "read"

Jube answered 12/6, 2017 at 15:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.