clone of github.com/decent-newsroom/newsroom
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

132 lines
4.9 KiB

fos_elastica:
clients:
default:
host: '%env(ELASTICSEARCH_HOST)%'
port: '%env(int:ELASTICSEARCH_PORT)%'
username: '%env(ELASTICSEARCH_USERNAME)%'
password: '%env(ELASTICSEARCH_PASSWORD)%'
indexes:
# create the index by running php bin/console fos:elastica:populate
articles:
index_name: '%env(ELASTICSEARCH_INDEX_NAME)%'
settings:
index:
# Increase refresh interval for better write performance
refresh_interval: "5s"
# Optimize indexing
number_of_shards: 1
number_of_replicas: 0
# Add query cache settings for faster repeated searches
queries:
cache:
enabled: true
# Optimize for search performance
max_result_window: 10000
analysis:
normalizer:
topic_norm:
type: custom
filter: [ lowercase, asciifolding ] # case & accent insensitive
analyzer:
custom_analyzer:
type: custom
tokenizer: standard
filter: [ lowercase, snowball, asciifolding ]
indexable_callback: [ 'App\Util\IndexableArticleChecker', 'isIndexable' ]
properties:
createdAt:
type: keyword
title:
type: text
analyzer: custom_analyzer
# Add term_vector for faster phrase queries
term_vector: with_positions_offsets
copy_to: search_combined
content:
type: text
analyzer: custom_analyzer
# Don't store norms for content to save space and improve speed
norms: false
copy_to: search_combined
summary:
type: text
analyzer: custom_analyzer
term_vector: with_positions_offsets
copy_to: search_combined
slug:
type: keyword
# Enable doc_values for faster sorting/aggregations
doc_values: true
pubkey:
type: keyword
topics:
type: keyword
normalizer: topic_norm
search_combined:
type: text
analyzer: standard
persistence:
driver: orm
model: App\Entity\Article
provider: ~
listener: ~
finder: ~
users:
index_name: '%env(ELASTICSEARCH_USER_INDEX_NAME)%'
settings:
index:
refresh_interval: "5s"
number_of_shards: 1
number_of_replicas: 0
queries:
cache:
enabled: true
max_result_window: 10000
analysis:
analyzer:
custom_analyzer:
type: custom
tokenizer: standard
filter: [ lowercase, snowball, asciifolding ]
properties:
npub:
type: keyword
doc_values: true
displayName:
type: text
analyzer: custom_analyzer
term_vector: with_positions_offsets
copy_to: search_combined
name:
type: text
analyzer: custom_analyzer
term_vector: with_positions_offsets
copy_to: search_combined
nip05:
type: keyword
copy_to: search_combined
about:
type: text
analyzer: custom_analyzer
norms: false
copy_to: search_combined
website:
type: keyword
picture:
type: keyword
banner:
type: keyword
lud16:
type: keyword
roles:
type: keyword
search_combined:
type: text
analyzer: standard
persistence:
driver: orm
model: App\Entity\User
provider:
service: App\Provider\UserProvider
listener: ~
finder: ~