Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ai
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
ai
Merge requests
!133
Provide a mechanism to combine vector search with traditional search
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Provide a mechanism to combine vector search with traditional search
issue/ai-3470414:3470414-combined-search
into
1.0.x
Overview
0
Commits
12
Pipelines
13
Changes
8
Merged
Scott Euser
requested to merge
issue/ai-3470414:3470414-combined-search
into
1.0.x
7 months ago
Overview
0
Commits
12
Pipelines
13
Changes
8
Expand
Closes
#3470414
0
0
Merge request reports
Compare
1.0.x
version 12
b22337f3
6 months ago
version 11
2f82a8ea
6 months ago
version 10
de6d589f
6 months ago
version 9
4764c019
6 months ago
version 8
becf94bc
6 months ago
version 7
8504d4dd
7 months ago
version 6
f55e3356
7 months ago
version 5
8cee95c0
7 months ago
version 4
0532cf59
7 months ago
version 3
dbcab8f8
7 months ago
version 2
647a73c0
7 months ago
version 1
92ba55af
7 months ago
1.0.x (base)
and
latest version
latest version
b22337f3
12 commits,
6 months ago
version 12
b22337f3
12 commits,
6 months ago
version 11
2f82a8ea
11 commits,
6 months ago
version 10
de6d589f
10 commits,
6 months ago
version 9
4764c019
9 commits,
6 months ago
version 8
becf94bc
8 commits,
6 months ago
version 7
8504d4dd
7 commits,
7 months ago
version 6
f55e3356
6 commits,
7 months ago
version 5
8cee95c0
5 commits,
7 months ago
version 4
0532cf59
4 commits,
7 months ago
version 3
dbcab8f8
3 commits,
7 months ago
version 2
647a73c0
2 commits,
7 months ago
version 1
92ba55af
1 commit,
7 months ago
8 files
+
522
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
8
Search (e.g. *.vue) (Ctrl+P)
modules/ai_search/src/EventSubscriber/SolrBoostByAiSearchEventSubscriber.php
0 → 100644
+
35
−
0
Options
<?php
namespace
Drupal\ai_search\EventSubscriber
;
use
Drupal\ai_search\Plugin\search_api
\processor\SolrBoostByAiSearch
;
use
Drupal\search_api_solr
\Event\PostConvertedQueryEvent
;
use
Symfony\Component\EventDispatcher\EventSubscriberInterface
;
/**
* Event subscriber to alter the Solarium query for AI boosting.
*/
class
SolrBoostByAiSearchEventSubscriber
implements
EventSubscriberInterface
{
/**
* Alters the Solarium query to boost AI results.
*
* @param \Drupal\ai_search\Event\PostConvertedQueryEvent $event
* The event containing the Solarium query.
*/
public
function
onPostConvertedQuery
(
PostConvertedQueryEvent
$event
)
{
$solarium_query
=
$event
->
getSolariumQuery
();
$query
=
$event
->
getSearchApiQuery
();
SolrBoostByAiSearch
::
queryAlter
(
$solarium_query
,
$query
);
}
/**
* {@inheritdoc}
*/
public
static
function
getSubscribedEvents
()
{
return
[
PostConvertedQueryEvent
::
class
=>
'onPostConvertedQuery'
,
];
}
}
Loading