Browse Source

added custom field type for apache_solr (see patch against searchapi_solr)

Signed-off-by: bachy <git@g-u-i.net>
bachy 12 years ago
parent
commit
f5e39e1209
1 changed files with 29 additions and 0 deletions
  1. 29 0
      materio_search_api.module

+ 29 - 0
materio_search_api.module

@@ -99,6 +99,35 @@ function materio_search_api_access_search(){
   return user_access('use materio search api for breves') || user_access('use materio search api');
 }
 
+/**
+ * Implements hook_search_api_data_type_info().
+ *
+ * Declare our new type to Search API so it can be selected for a field.
+ */
+function materio_search_api_search_api_data_type_info() {
+  return array(
+    'edge_n2_kw_text' => array(
+      'name' => t('Fulltext (partial)'),
+      'fallback' => 'text',
+    ),
+  );
+  return $types;
+}
+
+/**
+ * Implements hook_search_api_solr_dynamic_field_info().
+ *
+ * Tell Search API Solr how to index our new data type.
+ */
+function materio_search_api_search_api_solr_dynamic_field_info() {
+  return array(
+    'edge_n2_kw_text' => array(
+      'prefix' => 'tem',
+      'always multiValued' => TRUE,
+    ),
+  );
+}
+
 
 /**
  * hook_entity_property_info_alter().