GET /search
===========
Request Parameters:
========================== ======= ========= ======================================================================
Parameter Type Default Description
========================== ======= ========= ======================================================================
q String Lucene search String
sid String TextGrid SessionID from tgauth
target String both where to do fulltext-searches:
one of "structure", "metadata" and "both"
order String relevance key-value ascending (asc) or descending (desc) and
metadata-field like asc:title or desc:author
start Integer 0 result number to start with.
limit Integer 20 number of entries to return.
kwicWidth Integer 40 number of chars before and after a kwic match
wordDistance Integer -1 max distance beetween two words in fulltext query. ignored if set
to a number < 0, then for a hit all words must be contained in one document.
path Boolean false path of found result(work->edition->aggregations) should be applied to hit
allProjects Boolean false all Projects should be searched for public data,
warning: this query may be slow, if many results found
sandbox Boolean false show sandboxed (not yet finally published) data
filter String add filter on query results, e.g. for faceting (TODO: Syntax)
facet String get facets for query results
facetlimit Integer 10 number of results to return for each facet
========================== ======= ========= ======================================================================
Response:
List of TextGrid objects found. XML, using the textgrid medataschema
Example request::
curl https://textgridlab.org/1.0/tgsearch-public/search?q=waldeinsamkeit
Example response::
[...]
Search syntax
-------------
The search query passed with the parameter "q" can be written in lucene syntax, as described in lucene_syntax_
Facets and filters
------------------
For facetting the search result it is possible to generate facets on metadata fields.
These facets are generated on the whole set of objetcs matching the current search request.
The parameter facet is repeatable.
Example request (facets on format and agent)::
curl "https://textgridlab.org/1.0/tgsearch-public/search?q=waldeinsamkeit&facet=format&facet=edition.agent.value"
Example response::
[...]
text/xmltext/tg.edition+tg.aggregation+xmltext/tg.work+xmlEichendorff, Joseph vonBechstein, LudwigKerner, JustinusSchöppner, AlexanderArnim, Ludwig Achim vonGeibel, EmanuelGrässe, Johann Georg TheodorGutzkow, KarlHeine, HeinrichLingg, Hermann von
based on this facets it is possible to apply filter, e.g. all files with format "text/xml" where the agent is "Eichendorff, Joseph von".
Example request (filter for xml from agent Eichendorff)::
curl "https://textgridlab.org/1.0/tgsearch-public/search?q=waldeinsamkeit&filter=format:text/xml&filter=edition.agent.value:Eichendorff,%20Joseph%20von"
Example request (all image/jpeg files from the project "Digitale Bibliothek")::
curl "https://textgridlab.org/1.0/tgsearch-public/search/?filter=format:image/jpeg&filter=project.id:TGPR-372fe6dc-57f2-6cd4-01b5-2c4bbefcfd3c"
.. _lucene_syntax: https://textgridrep.org/en/syntax