In a unit test, I try to verify that the property "actionLink" is not searchable:
TestBean testBean = new TestBean();
testBean.setText("some searchable string");
CompassDetachedHits result = compassTemplate.findWithDetach("searchable");
Assert.assertEquals(1, result.getLength()); // succeeds
result = compassTemplate.findWithDetach("abc");
Assert.assertEquals(0, result.getLength()); // fails, 1 result is found
I thought, setting a property to index=Index.NO prevents it from being used during search. Why is the given object being found?
What do I miss here?
When you search like that, it actually translates to a query string: all:searchable. Even though you set the property not to be indexed, it will be added to the all property. You set it to be excluded from all as well.