aso2101 / satavahana-inscriptions

1 stars 0 forks source link

Search issues: ODD behaviours in search results #63

Open aso2101 opened 7 years ago

aso2101 commented 7 years ago

The list of search results doesn't use the ODD processing, and so all of the behaviours defined by the ODD (like brackets around unclear or supplied text, or replacing <ptr> elements with the <title> of the corresponding record) are not used. The result is that the search results don't look as one would expect them to look (try searching "Based on" in "Commentary": since this is always followed by a <ptr> element, it is always blank in the search results).

Is there a way to process the KWIC results with the ODD? (I imagine that this is non-trivial.) Otherwise we can think of other solutions (like writings special xquery transforms for the KWIC results).

wsalesky commented 7 years ago

@aso2101 This seems to do the trick without any noticeable of a performance hit. If it works as you expected, you may close the ticket.

See pull request: https://github.com/aso2101/satavahana-inscriptions/pull/71

aso2101 commented 7 years ago

After merging, I noticed that the following error occurs when I search for text (using chimu* as a test):

err:XPTY0004 expression to the left of a lookup operator needs to be a sequence of maps or arrays [at line 546, column 94, source: /db/apps/SAI/modules/app.xql] In function: (node()*, map?, xs:string?) [10:54:/db/apps/SAI/modules/pm-config.xql] app:show-hits(node()*, map, xs:integer, xs:integer) [221:18:/db/apps/SAI/modules/app.xql] templates:call-with-args(function, function*, element(), map) [208:13:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:process-output(element(), map, item()*, element()) [205:9:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:call-by-introspection(element(), map, map, function) [187:28:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:call(item(), element(), map) [135:36:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:process(node()*, map) [146:81:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:process(node()*, map) [146:81:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:process(node()*, map) [146:81:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:process(node()*, map) [146:81:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:process(node()*, map) [146:81:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:process(node()*, map) [146:81:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:process(node()*, map) [280:13:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:process-output(element(), map, item()*) [273:9:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:process-output(element(), map, item()*, element()) [205:9:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:call-by-introspection(element(), map, map, function) [187:28:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:call(item(), element(), map) [135:36:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:process(node()*, map) [146:81:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:process(node()*, map) [146:81:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:process(node()*, map) [146:81:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:process(node()*, map) [33:13:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] intl:translate(node(), map, xs:string?, xs:string?) [221:18:/db/apps/SAI/modules/lib/i18n-templates.xql] templates:call-with-args(function, function*, element(), map) [208:13:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:process-output(element(), map, item()*, element()) [205:9:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:call-by-introspection(element(), map, map, function) [187:28:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:call(item(), element(), map) [135:36:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:process(node()*, map) [527:9:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] pages:app-root(node(), map) [217:18:/db/apps/SAI/modules/lib/pages.xql] templates:call-with-args(function, function*, element(), map) [208:13:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:process-output(element(), map, item()*, element()) [205:9:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:call-by-introspection(element(), map, map, function) [187:28:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:call(item(), element(), map) [135:36:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:process(node()*, map) [465:17:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:process-output(element(), map, item()*) [273:9:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:process-output(element(), map, item()*, element()) [205:9:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:call-by-introspection(element(), map, map, function) [187:28:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:call(item(), element(), map) [135:36:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:process(node()*, map) [131:51:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:process(node()*, map) [88:9:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql] templates:apply(node()+, function, map?, map?) [49:5:/home/andrew/applications/eXistDB3/webapp/WEB-INF/data/expathrepo/shared-0.4.2/content/templates.xql]
wsalesky commented 6 years ago

Is this now on the master branch? I suspect a merge issue, and want to make sure I change it in the correct place. (I don't get the error on my local install, running the master branch. )

wsalesky commented 6 years ago

This should fix the issue.

aso2101 commented 6 years ago

ī am still getting the same error, with an indication that the problem is on line 512 of app.xql. Are the results appearing on your version?

wsalesky commented 6 years ago

Yes, this is what I am getting (see screen shot). I will do some investigating

On Wed, Sep 20, 2017 at 9:20 AM, Andrew Ollett notifications@github.com wrote:

ī am still getting the same error, with an indication that the problem is on line 512 of app.xql https://github.com/aso2101/satavahana-inscriptions/blob/7100066ef335bebb9610fe77aafe576261374172/modules/app.xql#L512. Are the results appearing on your version?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/aso2101/satavahana-inscriptions/issues/63#issuecomment-330848995, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHTTurro_2WaZPfP2MMeRzvuTJ5cAJEks5skREfgaJpZM4O3MsM .

wsalesky commented 6 years ago

Did you rebuild and deploy the branch? Or just upload the updated code? -Winona

On Wed, Sep 20, 2017 at 12:12 PM, Winona Salesky wsalesky@gmail.com wrote:

Yes, this is what I am getting (see screen shot). I will do some investigating

On Wed, Sep 20, 2017 at 9:20 AM, Andrew Ollett notifications@github.com wrote:

ī am still getting the same error, with an indication that the problem is on line 512 of app.xql https://github.com/aso2101/satavahana-inscriptions/blob/7100066ef335bebb9610fe77aafe576261374172/modules/app.xql#L512. Are the results appearing on your version?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/aso2101/satavahana-inscriptions/issues/63#issuecomment-330848995, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHTTurro_2WaZPfP2MMeRzvuTJ5cAJEks5skREfgaJpZM4O3MsM .

wsalesky commented 6 years ago

Any luck?

On Wed, Sep 20, 2017 at 12:30 PM, Winona Salesky wsalesky@gmail.com wrote:

Did you rebuild and deploy the branch? Or just upload the updated code? -Winona

On Wed, Sep 20, 2017 at 12:12 PM, Winona Salesky wsalesky@gmail.com wrote:

Yes, this is what I am getting (see screen shot). I will do some investigating

On Wed, Sep 20, 2017 at 9:20 AM, Andrew Ollett notifications@github.com wrote:

ī am still getting the same error, with an indication that the problem is on line 512 of app.xql https://github.com/aso2101/satavahana-inscriptions/blob/7100066ef335bebb9610fe77aafe576261374172/modules/app.xql#L512. Are the results appearing on your version?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/aso2101/satavahana-inscriptions/issues/63#issuecomment-330848995, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHTTurro_2WaZPfP2MMeRzvuTJ5cAJEks5skREfgaJpZM4O3MsM .

aso2101 commented 6 years ago

this is strange, because after rebuilding and deploying, i get the same issue. i wonder if it has to do with something in the data repository that is causing the app to fail to generate the right model for the hit. but i can't find any other evidence of a problem. what version of the data repository are you using? (also: your screenshot didn't come through.)

wsalesky commented 6 years ago

Can you try the new branch? (https://github.com/aso2101/satavahana-inscriptions/tree/issue63-alt) This works on my local install with a full rebuild of both data and application. However there are some quirks. For example, although a search returns a result if the element is suppressed by the ODD nothing will show up in the result. A good example is any search in the metadata. example: http://localhost:8080/exist/apps/SAI/search.html?query=gateway&filter=iMetadata

There are also instances where you get duplicated results, I assume the information is output twice in the HTML? example: http://localhost:8080/exist/apps/SAI/search.html?query=chimu*&filter=iText