Open ausi opened 3 years ago
+1 for DocumentInterface
. Not sure about the SearchQueryInterface
though; isn't the query always a string?
What is the difference between getTextsWithMatches()
and getContextWithMatches()
?
What is the difference between
getTextsWithMatches()
andgetContextWithMatches()
?
getTextsWithMatches()
would return the whole document text(s) where all matching words are marked. getContextWithMatches()
would only return a substring of speficied length relevant to the query.
But If we use a DocumentInterface
getTexts()
and getTextsWithMatches()
would probably be combined to a single method getDocument()
.
To make it possible to share code and don’t have to do our work for every CMS again and again, I think it would best If we could agree on a set of interfaces for the search.
The frontends for every CMS could then be based on those interfaces which would make it possible to share search backends across different projects.
For Contao we would create a MySQL backend for the search as this is our main use case.
A first draft of interfaces I have in mind (these are just a starting point to get the discussion going):
Instead of
array $texts
we should probably create aDocumentInterface
and forstring $query
aSearchQueryInterface
?