I'm trying to apply a chain "nonDrupalTable -> Data (Declare an entity type based on this table) -> Database Search + Search API" to build the search index on this table.

When I create the index, I get the error:
"SearchApiException: Unknown index prodz. в функции SearchApiDbService->search() (line 1121 in /search_api_db/service.inc)"

And when I try build the index, I get the error:
"SearchApiException while updating the fields of index prodz on server local_database_search: Entity type TABLE NAME doesn't specify a type for the ID property. in SearchApiDbService->fieldsUpdated() (line 684 of modules/search_api_db/service.inc)."

Any idea?

Comments

drunken monkey’s picture

Title: Don't create index on entity, created by Data module » hook_entity_property_info() should include types for all properties
Project: Search API Database Search » Data
Category: Support request » Bug report

As the error message states, it seems the entity property information the Data Entity module creates is incomplete.

As can be seen in its documentation, the type key is required for the property information returned in hook_entity_property_info(). The possible values can also be seen there. I would suggest just creating a simple mapping from the most common SQL data types to those types, and defaulting to text (or token) for all others.

Moving to the appropriate project. Please just ask if there's anything unclear.

joachim’s picture

Status: Active » Closed (duplicate)