forked from ErickTamayo/laravel-scout-elastic
-
Notifications
You must be signed in to change notification settings - Fork 6
/
elasticsearch.php
93 lines (81 loc) · 2.6 KB
/
elasticsearch.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
return [
/*
|--------------------------------------------------------------------------
| Elasticsearch host
|--------------------------------------------------------------------------
|
| Your Elasticsearch servers go here, by default it will use localhost. But
| you can change that here or in your environment file.
*/
'hosts' => [
env('ELASTICSEARCH_HOST', 'http://localhost'),
],
/*
|--------------------------------------------------------------------------
| Queries and query parameters
|--------------------------------------------------------------------------
|
| Here you can specify different search methods, and their parameters.
| The scout "search" method uses the default query type, with its parameters.
| If you use the "elasticSearch" method you can specify the query type and
| override the search parameters when performing the search.
|
*/
'queries' => [
'default' => 'query_string',
'query_string' => [
'default_operator' => "AND"
],
'multi_match' => [
'fields' => '_all',
'fuzziness' => 'auto'
]
],
/*
|--------------------------------------------------------------------------
| Elasticsearch indices
|--------------------------------------------------------------------------
|
| Here you can define your indices, with separate settings and mappings.
| You can choose which index a model belongs to my overriding the
| searchableWithin() method. A model will, by default, belong to the first
| index listed here.
|
| You may specify your mappings in the model if you like that approach,
| just make a static method, e.g. mapping() and refer to it here, like:
|
| 'mappings' => [
| 'articles' => \App\Article::mapping()
| ]
|
*/
'indices' => [
'laravel' => [
'settings' => [
"number_of_shards" => 1,
"number_of_replicas" => 0,
],
'mappings' => [
'articles' => [
'title' => [
'type' => 'string'
]
]
]
],
'another_index' => [
'settings' => [
"number_of_shards" => 1,
"number_of_replicas" => 0,
],
'mappings' => [
'articles' => [
'title' => [
'type' => 'string'
]
]
]
]
]
];