Dumb question, probably. But I enabled the module, yet I can't figure out how to add its operators to the fulltext search filter. The only operators are "contains" and "doesn't contain." What am I missing?

CommentFileSizeAuthor
#6 2012-09-13_034232.png17.63 KBheorhi lazarevich

Comments

jessepinho’s picture

For clarification: I'm trying to use it on the Label field (which correlates to the "title" varchar field in the DB, defined as "text" in hook_entity_property_info()) of my custom entity type.

Looks like line 14 of search_api_string_filter.views.inc only checks "string" type fields, not "text." So I put a dsm($field) call right after line 14 (inside the if{} statement) to see which fields it matched, and it only matched "Content type" and "Item language" fields (which of course isn't very useful for searching purposes).

Any thoughts?

(PS - Changing line 14 to "text" instead of "string" didn't fix the problem, either.)

jessepinho’s picture

OK, so I tested it on the Item language field, and it's giving me the following error:
PHP Fatal error: Call to undefined method SearchApiViewsQuery::placeholder() in [...]/sites/all/modules/contrib/views/includes/handlers.inc on line 596

I believe this is based on the call to $this->placeholder() on line 272 of handler_filter_string.inc.

attiks’s picture

Assigned: Unassigned » jelle_s
jelle_s’s picture

Status: Active » Fixed

The fatal error should be solved,
and for the fulltext filtering: The solution you suggested (changing 'string' to 'text') works, but you have to clear the cache after that change ;-)

I changed

if ($inner_type == 'string') {

to

if ($inner_type == 'string' || $inner_type == 'text') {

so it works for both now.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

heorhi lazarevich’s picture

Status: Closed (fixed) » Active
StatusFileSize
new17.63 KB

I tried 7.x-1.0 and 7.x-1.x-dev versions of the module. In both cases, for full text search filter only operators "contains" and "doesn't contain" are avaliable.screen

attiks’s picture

Title: How do I, you know, use it? » Allow it also on 'Fulltext search'
Version: 7.x-1.0 » 7.x-1.x-dev
Component: User interface » Code
Category: support » feature

For the moment this only works on the indexed field (like title, main body), it doesn't work on the special search field 'fulltext search'.

Changing this into a feature request, we'll see how we can solve this.

jelle_s’s picture

Because of the way the 'Fulltext search' is created, this can not be supported, it expects to only have 2 operators = and <> (see search_api/contrib/search_api_views/includes/handler_filter_fulltext.inc lines 93 -> 101) and this behavior can not be changed, even if we overwrite the handler, servers will still expect this behavior and implement it in their createKeysQuery method (see search_api_db/service.inc line 805 and further).

The only thing I can advise you is to create a filter for each seperate indexed field (see #7), put them all in an OR group and then use Views filters populate to populate them all with the same value.

jelle_s’s picture

Status: Active » Closed (won't fix)