search api autocomplete withour accent, and splitting numbers (fruhstuck40)
This commit is contained in:
parent
dd22a6e143
commit
aca756e64d
|
@ -7,7 +7,6 @@ dependencies:
|
||||||
- taxonomy
|
- taxonomy
|
||||||
- synonyms
|
- synonyms
|
||||||
- search_api
|
- search_api
|
||||||
- materio_sapi
|
|
||||||
config:
|
config:
|
||||||
- field.storage.taxonomy_term.field_synonyms
|
- field.storage.taxonomy_term.field_synonyms
|
||||||
- search_api.server.database_search_autocomplete
|
- search_api.server.database_search_autocomplete
|
||||||
|
@ -61,7 +60,7 @@ field_settings:
|
||||||
label: Synonyms
|
label: Synonyms
|
||||||
datasource_id: 'entity:taxonomy_term'
|
datasource_id: 'entity:taxonomy_term'
|
||||||
property_path: field_synonyms
|
property_path: field_synonyms
|
||||||
type: 'solr_text_custom:edgestring'
|
type: 'solr_text_custom:edgeasciistring'
|
||||||
dependencies:
|
dependencies:
|
||||||
config:
|
config:
|
||||||
- field.storage.taxonomy_term.field_synonyms
|
- field.storage.taxonomy_term.field_synonyms
|
||||||
|
@ -69,7 +68,7 @@ field_settings:
|
||||||
label: Name
|
label: Name
|
||||||
datasource_id: 'entity:taxonomy_term'
|
datasource_id: 'entity:taxonomy_term'
|
||||||
property_path: name
|
property_path: name
|
||||||
type: 'solr_text_custom:edgestring'
|
type: 'solr_text_custom:edgeasciistring'
|
||||||
boost: !!float 2
|
boost: !!float 2
|
||||||
dependencies:
|
dependencies:
|
||||||
module:
|
module:
|
||||||
|
@ -119,7 +118,6 @@ processor_settings:
|
||||||
solr_date_range:
|
solr_date_range:
|
||||||
weights:
|
weights:
|
||||||
preprocess_index: 0
|
preprocess_index: 0
|
||||||
term_used: { }
|
|
||||||
type_boost:
|
type_boost:
|
||||||
boosts:
|
boosts:
|
||||||
'entity:taxonomy_term':
|
'entity:taxonomy_term':
|
||||||
|
|
|
@ -9,6 +9,7 @@ dependencies:
|
||||||
- search_api_solr.solr_cache.cache_persegfilter_default_7_0_0
|
- search_api_solr.solr_cache.cache_persegfilter_default_7_0_0
|
||||||
- search_api_solr.solr_cache.cache_queryresult_default_7_0_0
|
- search_api_solr.solr_cache.cache_queryresult_default_7_0_0
|
||||||
- search_api_solr.solr_field_type.text_edge_und_7_0_0
|
- search_api_solr.solr_field_type.text_edge_und_7_0_0
|
||||||
|
- search_api_solr.solr_field_type.text_edgestring_ascii_und_6_0_0
|
||||||
- search_api_solr.solr_field_type.text_edgestring_und_6_0_0
|
- search_api_solr.solr_field_type.text_edgestring_und_6_0_0
|
||||||
- search_api_solr.solr_field_type.text_en_7_0_0
|
- search_api_solr.solr_field_type.text_en_7_0_0
|
||||||
- search_api_solr.solr_field_type.text_fr_7_0_0
|
- search_api_solr.solr_field_type.text_fr_7_0_0
|
||||||
|
@ -47,9 +48,10 @@ backend_config:
|
||||||
commit_within: 1000
|
commit_within: 1000
|
||||||
solr_version: '8'
|
solr_version: '8'
|
||||||
http_method: AUTO
|
http_method: AUTO
|
||||||
jmx: false
|
|
||||||
solr_install_dir: ../../..
|
|
||||||
skip_schema_check: false
|
skip_schema_check: false
|
||||||
|
jmx: false
|
||||||
|
jts: false
|
||||||
|
solr_install_dir: ../../..
|
||||||
disabled_field_types: { }
|
disabled_field_types: { }
|
||||||
disabled_caches: { }
|
disabled_caches: { }
|
||||||
disabled_request_handlers:
|
disabled_request_handlers:
|
||||||
|
@ -59,12 +61,12 @@ backend_config:
|
||||||
disabled_request_dispatchers:
|
disabled_request_dispatchers:
|
||||||
- request_dispatcher_httpcaching_default_7_0_0
|
- request_dispatcher_httpcaching_default_7_0_0
|
||||||
rows: 10
|
rows: 10
|
||||||
|
index_single_documents_fallback_count: 10
|
||||||
retrieve_data: true
|
retrieve_data: true
|
||||||
highlight_data: false
|
highlight_data: false
|
||||||
|
fallback_multiple: true
|
||||||
server_prefix: ''
|
server_prefix: ''
|
||||||
domain: generic
|
domain: generic
|
||||||
environment: default
|
environment: default
|
||||||
optimize: false
|
optimize: false
|
||||||
site_hash: true
|
site_hash: true
|
||||||
index_single_documents_fallback_count: 10
|
|
||||||
fallback_multiple: true
|
|
||||||
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
uuid: af25836c-6eca-4621-a803-7a7394fff660
|
||||||
|
langcode: en
|
||||||
|
status: true
|
||||||
|
dependencies: { }
|
||||||
|
_core:
|
||||||
|
default_config_hash: 2jPHrZPHYA4ZBHAbJDAoVD465MybfBXiepOZsUHyg-o
|
||||||
|
id: text_edgestring_ascii_und_6_0_0
|
||||||
|
label: 'Edge NGram ASCII String Field'
|
||||||
|
minimum_solr_version: 6.0.0
|
||||||
|
custom_code: edgeasciistring
|
||||||
|
field_type_language_code: und
|
||||||
|
domains: { }
|
||||||
|
field_type:
|
||||||
|
name: text_edgenasciistring
|
||||||
|
class: solr.TextField
|
||||||
|
positionIncrementGap: 100
|
||||||
|
analyzers:
|
||||||
|
-
|
||||||
|
type: index
|
||||||
|
tokenizer:
|
||||||
|
class: solr.StandardTokenizerFactory
|
||||||
|
filters:
|
||||||
|
-
|
||||||
|
class: solr.LowerCaseFilterFactory
|
||||||
|
-
|
||||||
|
class: solr.RemoveDuplicatesTokenFilterFactory
|
||||||
|
-
|
||||||
|
class: solr.EdgeNGramFilterFactory
|
||||||
|
minGramSize: 2
|
||||||
|
maxGramSize: 25
|
||||||
|
-
|
||||||
|
class: solr.ASCIIFoldingFilterFactory
|
||||||
|
preserveOriginal: true
|
||||||
|
-
|
||||||
|
class: solr.WordDelimiterGraphFilterFactory
|
||||||
|
preserveOriginal: 1
|
||||||
|
-
|
||||||
|
type: query
|
||||||
|
tokenizer:
|
||||||
|
class: solr.StandardTokenizerFactory
|
||||||
|
filters:
|
||||||
|
-
|
||||||
|
class: solr.LowerCaseFilterFactory
|
||||||
|
-
|
||||||
|
class: solr.RemoveDuplicatesTokenFilterFactory
|
||||||
|
-
|
||||||
|
class: solr.ASCIIFoldingFilterFactory
|
||||||
|
preserveOriginal: true
|
||||||
|
-
|
||||||
|
class: solr.WordDelimiterGraphFilterFactory
|
||||||
|
preserveOriginal: 1
|
||||||
|
unstemmed_field_type: null
|
||||||
|
spellcheck_field_type: null
|
||||||
|
collated_field_type: null
|
||||||
|
solr_configs: { }
|
||||||
|
text_files: { }
|
|
@ -0,0 +1,52 @@
|
||||||
|
langcode: en
|
||||||
|
status: true
|
||||||
|
dependencies:
|
||||||
|
module:
|
||||||
|
- search_api_solr
|
||||||
|
id: text_edgestring_ascii_und_6_0_0
|
||||||
|
label: 'Edge NGram ASCII String Field'
|
||||||
|
minimum_solr_version: 6.0.0
|
||||||
|
custom_code: 'edgeasciistring'
|
||||||
|
field_type_language_code: und
|
||||||
|
domains: {}
|
||||||
|
field_type:
|
||||||
|
name: text_edgenasciistring
|
||||||
|
class: solr.TextField
|
||||||
|
positionIncrementGap: 100
|
||||||
|
analyzers:
|
||||||
|
-
|
||||||
|
type: index
|
||||||
|
tokenizer:
|
||||||
|
class: solr.StandardTokenizerFactory
|
||||||
|
filters:
|
||||||
|
-
|
||||||
|
class: solr.LowerCaseFilterFactory
|
||||||
|
-
|
||||||
|
class: solr.RemoveDuplicatesTokenFilterFactory
|
||||||
|
-
|
||||||
|
class: solr.EdgeNGramFilterFactory
|
||||||
|
minGramSize: 2
|
||||||
|
maxGramSize: 25
|
||||||
|
-
|
||||||
|
class: solr.ASCIIFoldingFilterFactory
|
||||||
|
preserveOriginal: true
|
||||||
|
-
|
||||||
|
class: solr.WordDelimiterGraphFilterFactory
|
||||||
|
preserveOriginal: 1
|
||||||
|
-
|
||||||
|
type: query
|
||||||
|
tokenizer:
|
||||||
|
class: solr.StandardTokenizerFactory
|
||||||
|
filters:
|
||||||
|
-
|
||||||
|
class: solr.LowerCaseFilterFactory
|
||||||
|
-
|
||||||
|
class: solr.RemoveDuplicatesTokenFilterFactory
|
||||||
|
-
|
||||||
|
class: solr.ASCIIFoldingFilterFactory
|
||||||
|
preserveOriginal: true
|
||||||
|
-
|
||||||
|
class: solr.WordDelimiterGraphFilterFactory
|
||||||
|
preserveOriginal: 1
|
||||||
|
solr_configs: {}
|
||||||
|
text_files: {}
|
|
@ -8,7 +8,7 @@ use Drupal\Core\Controller\ControllerBase;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Drupal\Component\Utility\Tags;
|
use Drupal\Component\Utility\Tags;
|
||||||
use Drupal\Component\Utility\Unicode;
|
// use Drupal\Component\Utility\Unicode;
|
||||||
use Drupal\search_api\Entity\Index;
|
use Drupal\search_api\Entity\Index;
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,7 +24,8 @@ class FormAutocomplete extends ControllerBase {
|
||||||
// Get the typed string from the URL, if it exists.
|
// Get the typed string from the URL, if it exists.
|
||||||
if ($input = $request->query->get('q')) {
|
if ($input = $request->query->get('q')) {
|
||||||
$typed_string = Tags::explode($input);
|
$typed_string = Tags::explode($input);
|
||||||
$typed_string = Unicode::strtolower(array_pop($typed_string));
|
// $typed_string = Unicode::strtolower(array_pop($typed_string));
|
||||||
|
$typed_string = mb_strtolower(array_pop($typed_string));
|
||||||
// \Drupal::logger('materio_sapi')->notice($typed_string);
|
// \Drupal::logger('materio_sapi')->notice($typed_string);
|
||||||
|
|
||||||
$index = Index::load('autocomplete');
|
$index = Index::load('autocomplete');
|
||||||
|
|
Loading…
Reference in New Issue