Skip to content

Commit

Permalink
Issue #3475570 by valthebald, mkalkbrenner: Solr-based alternative to…
Browse files Browse the repository at this point in the history
… dblog
  • Loading branch information
mkalkbrenner committed Jan 14, 2025
1 parent c575286 commit 8ece99c
Show file tree
Hide file tree
Showing 20 changed files with 2,892 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/jump-start-config-sets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ jobs:
php -v
composer config platform.php ${{ matrix.php }}.0
composer config repositories.search_api_solr '{"type": "vcs", "url": "../search_api_solr"}'
composer require ${{ matrix.solarium }} drupal/search_api_solr:${{ env.NEXT_MODULE_VERSION }} drupal/search_api_autocomplete:1.x-dev drupal/search_api_spellcheck:4.0.x-dev drupal/facets:3.0.x-dev drupal/devel drupal/search_api_location:1.x-dev drupal/geofield drush/drush monolog/monolog --no-interaction
composer require ${{ matrix.solarium }} drupal/search_api_solr:${{ env.NEXT_MODULE_VERSION }} drupal/search_api_autocomplete:1.x-dev drupal/search_api_spellcheck:4.0.x-dev drupal/facets:3.0.x-dev drupal/better_exposed_filters drupal/devel drupal/search_api_location:1.x-dev drupal/geofield drush/drush monolog/monolog --no-interaction
# search_api was installed as dependency above. This is a required check! Now switch to the latest dev version.
composer require drupal/search_api:1.x-dev --no-interaction
# cd modules/contrib/search_api
Expand All @@ -255,7 +255,7 @@ jobs:
cd drupal
php -S localhost:8888 >& /dev/null &
vendor/bin/drush si standard --db-url=sqlite://sites/default/files/db.sqlite --yes
vendor/bin/drush en search_api_solr_admin,search_api_solr_devel,search_api_solr_legacy,search_api_spellcheck,search_api_solr_autocomplete,facets,search_api_location --yes
vendor/bin/drush en search_api_solr_admin,search_api_solr_devel,search_api_solr_legacy,search_api_solr_log,search_api_spellcheck,search_api_solr_autocomplete,facets,search_api_location --yes
vendor/bin/phpunit -v -c core --group search_api_solr --exclude-group not_drupal${{ matrix.drupal }},not_solr${{ matrix.solr }} modules/contrib/search_api_solr
vendor/bin/drush cim --partial --source=modules/contrib/search_api_solr/jump-start/drupal_configs --yes
vendor/bin/drush -v solr-gsc solr_cloud test-config-generation.zip
Expand Down
9 changes: 9 additions & 0 deletions modules/search_api_solr_log/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Search API Solr Log

This module provides an alternative to the DB Logger of Drupal Core.

After enabling the module, visit `/admin/config/search/search-api/server/search_api_solr_log_server/editSolr` and
configure the connection according to your needs.

Note, if you don't have a dedicated log server, you can use the identical settings of an existing server.
But it is important to activate "Advanced / Retrieve result data from Solr".
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
langcode: en
status: true
dependencies:
config:
- search_api.server.search_api_solr_log_server
module:
- search_api_solr
third_party_settings:
search_api_solr:
finalize: false
commit_before_finalize: false
commit_after_finalize: false
debug_finalize: false
highlighter:
maxAnalyzedChars: 51200
fragmenter: gap
usePhraseHighlighter: true
highlightMultiTerm: true
preserveMulti: false
regex:
slop: 0.5
pattern: blank
maxAnalyzedChars: 10000
highlight:
mergeContiguous: false
requireFieldMatch: false
snippets: 3
fragsize: 0
mlt:
mintf: 1
mindf: 1
maxdf: 0
maxdfpct: 0
minwl: 0
maxwl: 0
maxqt: 100
maxntp: 2000
boost: false
interestingTerms: none
term_modifiers:
slop: 3
fuzzy: 1
fuzzy_analyzer: true
advanced:
index_prefix: ''
collection: ''
timezone: ''
multilingual:
limit_to_content_language: false
include_language_independent: true
use_language_undefined_as_fallback_language: false
specific_languages:
en: '0'
de: '0'
fr: '0'
pl: '0'
it: '0'
es: '0'
cs: '0'
hu: '0'
ro: '0'
bg: '0'
el: '0'
hr: '0'
sk: '0'
sl: '0'
sr: '0'
nl: '0'
use_universal_collation: false
id: search_api_solr_log
name: 'Solr Log'
description: ''
read_only: true
field_settings:
hostname:
label: Hostname
datasource_id: solr_document
property_path: ss_hostname
type: string
id:
label: Id
datasource_id: solr_document
property_path: id
type: string
index_id:
label: 'Index ID'
datasource_id: solr_document
property_path: index_id
type: string
location:
label: Location
datasource_id: solr_document
property_path: ss_location
type: string
message:
label: Message
datasource_id: solr_document
property_path: tus_message
type: text
message_en:
label: 'Message English'
datasource_id: solr_document
property_path: ts_X3b_en_message
type: text
referer:
label: Referer
datasource_id: solr_document
property_path: ss_referer
type: string
severity:
label: Severity
datasource_id: solr_document
property_path: its_severity
type: integer
timestamp:
label: Timestamp
datasource_id: solr_document
property_path: timestamp
type: date
type:
label: Type
datasource_id: solr_document
property_path: ss_type
type: string
uid:
label: 'User ID'
datasource_id: solr_document
property_path: its_uid
type: integer
variables:
label: Variables
datasource_id: solr_document
property_path: zs_variables
type: string
datasource_settings:
solr_document:
id_field: id
request_handler: ''
default_query: '*:*'
label_field: ''
language_field: ''
url_field: ''
processor_settings:
add_url: { }
aggregated_field: { }
auto_aggregated_fulltext_field: { }
custom_value: { }
entity_type: { }
language_with_fallback: { }
rendered_item: { }
solr_date_range: { }
tracker_settings:
default:
indexing_order: fifo
options:
cron_limit: 50
delete_on_fail: true
index_directly: false
track_changes_in_references: false
server: search_api_solr_log_server
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
langcode: en
status: true
dependencies:
module:
- search_api_solr
id: search_api_solr_log_server
name: 'Solr Log Server'
description: 'Adjust the settings to your needs. Note, if you don''t have a dedicated log server, you can use the identical settings of an existing server. But it is important to activate "Advanced / Retrieve result data from Solr".'
backend: search_api_solr
backend_config:
retrieve_data: true
highlight_data: false
site_hash: false
server_prefix: ''
domain: generic
environment: default
connector: standard
connector_config:
scheme: http
host: localhost
port: 8983
path: /
core: drupal
timeout: 5
index_timeout: 5
optimize_timeout: 10
finalize_timeout: 30
skip_schema_check: false
solr_version: ''
http_method: AUTO
commit_within: 1000
jmx: false
jts: false
solr_install_dir: ''
optimize: false
fallback_multiple: false
disabled_field_types: { }
disabled_caches: { }
disabled_request_handlers:
- request_handler_elevate_default_7_0_0
- request_handler_replicationmaster_default_7_0_0
- request_handler_replicationslave_default_7_0_0
disabled_request_dispatchers:
- request_dispatcher_httpcaching_default_7_0_0
rows: 10
index_single_documents_fallback_count: 10
index_empty_text_fields: false
suppress_missing_languages: false
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
days_to_keep: 14
Loading

0 comments on commit 8ece99c

Please sign in to comment.