Skip to content

Commit

Permalink
occurences et indexes systématiquement dans un array (#758)
Browse files Browse the repository at this point in the history
  • Loading branch information
emchateau committed Jul 9, 2020
1 parent 1b9337f commit 82dfd82
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions models/tei.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ declare function getItemById($queryParams as map(*)) as map(*) {
'itemAfterTitle' : getSectionTitle($itemAfter), (: is a sequence :)
'itemAfterUrl' : getUrl($itemAfter/@xml:id, '/items/', $lang),
'itemAfterUuid' : $itemAfter/@xml:id,
'indexes' : getIndexEntries($item)
'indexes' : array{getIndexEntries($item)}
}
return map{
'meta' : $meta,
Expand Down Expand Up @@ -872,7 +872,7 @@ declare function getSearchExact($queryParams) {
'extract' : ft:extract($result[text() contains text {$queryParams?search}]),
'textId' : $textId,
'score' : $s,
'indexes' : getIndexEntries($segment),
'indexes' : array{getIndexEntries($segment)},
'uuid' : $uuid,
'path' : '/items/',
'url' : $gdp.globals:root || '/items/' || $uuid,
Expand Down Expand Up @@ -904,7 +904,7 @@ declare function getSearchAny($queryParams) {
'extract' : ft:extract($result[text() contains text {for $w in fn:tokenize($queryParams?search, ' ') return $w}]),
'textId' : $textId,
'score' : $s,
'indexes' : getIndexEntries($segment),
'indexes' : array{getIndexEntries($segment)},
'uuid' : $uuid,
'path' : '/items/',
'url' : $gdp.globals:root || '/items/' || $uuid,
Expand Down Expand Up @@ -936,7 +936,7 @@ declare function getSearchAllWord($queryParams) {
'extract' : ft:extract($result[text() contains text {for $w in fn:tokenize($queryParams?search, ' ') return $w}]),
'textId' : $textId,
'score' : $s,
'indexes' : getIndexEntries($segment),
'indexes' : array{getIndexEntries($segment)},
'uuid' : $uuid,
'path' : '/items/',
'url' : $gdp.globals:root || '/items/' || $uuid
Expand Down Expand Up @@ -968,7 +968,7 @@ declare function getSearchPhrase($queryParams) {
'textId' : $textId,
'score' : $s,
'uuid' : $uuid,
'indexes' : getIndexEntries($segment),
'indexes' : array{getIndexEntries($segment)},
'path' : '/items/',
'url' : $gdp.globals:root || '/items/' || $uuid,
'combining' : 'phrase'
Expand Down Expand Up @@ -998,7 +998,7 @@ declare function getSearchAll($queryParams) {
'extract' : ft:extract($result[text() contains text {for $w in fn:tokenize($queryParams?search, ' ') return $w}]),
'textId' : $textId,
'score' : $s,
'indexes' : getIndexEntries($segment),
'indexes' : array{getIndexEntries($segment)},
'uuid' : $uuid,
'path' : '/items/',
'url' : $gdp.globals:root || '/items/' || $uuid,
Expand Down Expand Up @@ -1116,7 +1116,7 @@ declare function getIndexLocorumItem($queryParams as map(*)) as map(*) {
'uuid' : fn:string($uuid),
'path' : '/indexLocorum/',
'url' : $gdp.globals:root || '/indexLocorum/' || $uuid,
'occurences' : getOccurences($entry)
'occurences' : array{getOccurences($entry)}
}
return map{
'meta' : $meta,
Expand Down Expand Up @@ -1171,7 +1171,7 @@ declare function getIndexNominumItem($queryParams as map(*)) as map(*) {
let $lang := 'fr'
let $dateFormat := 'jjmmaaa'
let $itemId := map:get($queryParams, 'itemId')
let $entry := synopsx.models.synopsx:getDb($queryParams)//tei:person[@xml:id = $itemId]
let $entry := synopsx.models.synopsx:getDb($queryParams)//tei:listPerson/tei:person[@xml:id = $itemId]
let $meta := map{
'rubrique' : 'Entrée d’index des personnes',
'author' : 'Guides de Paris',
Expand Down Expand Up @@ -1200,7 +1200,7 @@ declare function getIndexNominumItem($queryParams as map(*)) as map(*) {
'url' : $gdp.globals:root || '/indexNominum/' || $uuid,
'attestedForms' : for $name in db:open('gdp')//tei:persName[@xml:id = $entry/tei:listRelation/tei:relation/@passive ! fn:tokenize(., ' ') ! fn:substring-after(., '#')]
return $name,
'occurences' : getOccurences($entry)
'occurences' : array{getOccurences($entry)}
}
return map{
'meta' : $meta,
Expand Down Expand Up @@ -1292,7 +1292,7 @@ declare function getIndexOperumItem($queryParams as map(*)) as map(*) {
'uuid' : fn:string($uuid),
'path' : '/items/',
'url' : $gdp.globals:root || '/items/' || $uuid,
'occurences' : getOccurences($entry)
'occurences' : array{getOccurences($entry)}
}
return map{
'meta' : $meta,
Expand Down

0 comments on commit 82dfd82

Please sign in to comment.