(refactor) Move search service into services-satellite

This commit is contained in:
Viktor Lofgren 2023-10-09 13:40:01 +02:00
parent 97e17282ab
commit c0e61d4c87
74 changed files with 13 additions and 19 deletions

View file

@ -32,7 +32,7 @@ dependencies {
implementation project(':code:libraries:message-queue')
implementation project(':code:libraries:language-processing')
implementation project(':third-party:commons-codec')
testImplementation project(':code:services-core:search-service')
testImplementation project(':code:services-satellite:search-service')
implementation project(':code:process-models:crawling-model')
implementation project(':code:process-models:processed-data')

View file

@ -14,12 +14,13 @@ A map of the most important components and how they relate can be found below.
### Services
* [core services](services-core/) "macroservices", stateful, memory hungry doing heavy lifting.
* * [control-service](services-core/control-service)
* * [search](services-core/search-service)
* * [control-service](services-core/control-service)
* * [query](services-core/query-service)
* * [index](services-core/index-service)
* * [assistant](services-core/assistant-service)
* [satellite services](services-satellite/) "microservices", stateless providing additional functionality.
* * [api](services-satellite/api-service) - public API
* * [search](services-core/search-service) - marginalia search application
* * [dating](services-satellite/dating-service) - [https://explore.marginalia.nu/](https://explore.marginalia.nu/)
* * [explorer](services-satellite/explorer-service) - [https://explore2.marginalia.nu/](https://explore2.marginalia.nu/)
* an [internal API](api/)

View file

@ -27,12 +27,10 @@ import java.util.List;
@Singleton
public class QueryFactory {
private final Logger logger = LoggerFactory.getLogger(getClass());
private static final int RETAIN_QUERY_VARIANT_COUNT = 5;
private final ThreadLocal<QueryVariants> queryVariants;
private final QueryParser queryParser = new QueryParser();
@ -44,9 +42,6 @@ public class QueryFactory {
this.queryVariants = ThreadLocal.withInitial(() -> new QueryVariants(lm ,dict, nGramBloomFilter, englishDictionary));
}
public QueryParser getParser() {
return new QueryParser();
}
public QueryPermutation getQueryPermutation() {
return new QueryPermutation(queryVariants.get());
@ -153,9 +148,6 @@ public class QueryFactory {
return new ProcessedQuery(specs, searchTermsHuman, domain);
}
private String normalizeDomainName(String str) {
return str.toLowerCase();
}

View file

@ -2,7 +2,6 @@ package nu.marginalia.query.svc;
import nu.marginalia.index.client.model.query.SearchSubquery;
import nu.marginalia.language.WordPatterns;
import nu.marginalia.query.model.QueryParams;
import nu.marginalia.query_parser.token.Token;
import nu.marginalia.query_parser.token.TokenVisitor;

View file

@ -1,13 +1,13 @@
# Core Services
The cores services constitute the main functionality of the search engine.
* The [search-service](search-service/) parses queries, interrogates the index-service,
and decorates search results with metadata from the database.
The cores services constitute the main functionality of the search engine,
*relatively* agnostic to the Marginalia application.
* The [index-service](index-service/) contains the indexes, it answers questions about
which documents contain which terms.
* The [query-service](query-service/) Interprets queries and delegates work to index-service.
* The [control-service](control-service/) provides an operator's user interface, and is responsible
for orchestrating the various processes of the system.

View file

@ -1,7 +1,9 @@
# Satellite Services
# Application Services
The satellite services offer non-essential functionality.
The application services offer user interfaces/applications around
interacting with the [core services](../services-core).
* The [api-service](api-service/) offers a public API
* The [dating-service](dating-service/) is [explore.marginalia.nu](https://explore.marginalia.nu/)
* The [explorer-service](dating-service/) is [explore2.marginalia.nu](https://explore2.marginalia.nu/)
* The [search-service](search-service/) is the main application for [search.marginalia.nu](https://search.marginalia.nu/)

View file

@ -2,10 +2,10 @@ rootProject.name = 'marginalia.nu'
include 'code:services-core:index-service'
include 'code:services-core:assistant-service'
include 'code:services-core:search-service'
include 'code:services-core:control-service'
include 'code:services-core:query-service'
include 'code:services-satellite:search-service'
include 'code:services-satellite:api-service'
include 'code:services-satellite:dating-service'
include 'code:services-satellite:explorer-service'