We investigated the behavior of IntAttr and StrAttr added from V2.
If you want to use a filter, set the filter condition in setFilter.
request.setFilter("int_attr=10000 AND str_attr=\"Ah ah\"");
Please refer to [Search] for the entire source.
The int_attr field supports the>,> =, <, <=, = operators.
request.setFilter("int_attr=10000");
Information with an IntAttr value of 10,000 will be hit.
request.setFilter("int_attr<10000");
Information with an IntAttr value less than 10,000 will be hit.
request.setFilter("int_attr>10000");
Information with an IntAttr value greater than 10,000 and data with ** not set (NULL) ** are hit. It is important to note that values that have not been set can be taken.
request.setFilter("int_attr>=10000 AND int_attr<=20000");
Data with IntAttr value of 10,000 or more and 20,000 or less will be hit.
request.setFilter("int_attr=");
An error is returned. The value must be set.
request.setFilter("int_attr<0");
There are 0 hits. Since only integers can be set, nothing will be hit.
request.setFilter("int_attr=30 OR int_attr=100000");
Information with an IntAttr value of 30 or 100,000 will be hit.
request.setFilter("int_attr="+Integer.MAX_VALUE);
Information for which IntAttr is not set is a hit. Apparently, if IntAttr is omitted at the time of registration, the maximum value of Integer is set.
The str_attr field supports the =,! = Operators.
request.setFilter("str_attr=\"furniture\"");
Information that exactly matches "furniture" is a hit. The information that set "furniture, desk" was not hit.
request.setFilter("str_attr!=\"Furniture: bookshelf\"");
Information other than the one that exactly matches "furniture" and information for which StrAttr is not set are hit.
request.setFilter("str_attr=\"\"");
Only the information for which StrAttr is not set is hit.
You need to consider the behavior for data for which no filter conditions have been set. You can get each of them with the above contents, so please set them in the filter conditions. Also, multiple conditions can be set by using "AND" and "OR". IntAttr and StrAttr can also be filtered at the same time.
Recommended Posts