Search description with "/" charactere

1,103 views
Skip to first unread message

tat...@gmail.com

unread,
Aug 20, 2016, 4:52:29 PM8/20/16
to AtoM Users
Hi everyone,

I was trying to find a description with the name 20/1945 and I got the folling error:

2016/08/20 20:49:05 [error] 6028#6028: *34 FastCGI sent in stderr: "PHP message: This request has been forwarded to a 404 error page by the action "search/autocomplete"" while reading response header from upstream, client: 177.133.68.137, server: _, request: "GET /index.php/search/autocomplete?query=20%2F1945&repos=435 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.atom.sock:", host: "stm.arqunb.com.br", referrer: "http://stm.arqunb.com.br/index.php/inquerito-policial-militar-processo-n-20-1945"

I alreary tried:
Regenerate slugs: php symfony propel:generate-slugs
Rebuild the nested set:  php symfony propel:build-nested-set
Clear cache: php symfony cc
Restart PHP5-FPM and Memcached: sudo service php5-fpm restart && sudo /etc/init.d/memcached restart

But I got the same error.

Can anyone help me me?

Thanks,
Tatiana Canelhas

Gomes Silva

unread,
Aug 21, 2016, 10:30:07 PM8/21/16
to AtoM Users, tat...@gmail.com
I think this is related to ElasticSearch where slashes or quotations are interpreted as part of a regular expression, so try searching "20/1945" instead.

Using a single slash (/) or a single quotation mark (") won't work but there seems to be a workaround here: https://groups.google.com/forum/#!searchin/ica-atom-users/slash$20error%7Csort:relevance/ica-atom-users/7BZ7xOkm7K4/nN13wWLybfcJ

Dan Gillean

unread,
Aug 22, 2016, 12:47:01 PM8/22/16
to ICA-AtoM Users
Hi all,

Gomes, thank you for answering! Tatiana, Gomes is correct - in Elasticsearch, there are certain special characters that are reserved as operators, and the slash is one of them. However, adding a forward-slash BEFORE an operator should escape it. From the Elasticsearch 1.7 documentation:

If you need to use any of the characters which function as operators in your query itself (and not as operators), then you should escape them with a leading backslash. For instance, to search for (1+1)=2, you would need to write your query as \(1\+1\)\=2.

The reserved characters are: + - = && || > < ! ( ) { } [ ] ^ " ~ * ? : \ /

Failing to escape these special characters correctly could lead to a syntax error which prevents your query from running.


When you put something in quotations, you are searching for an exact string match, so the special characters are ignored. I haven't tested this myself yet today, but:

For an exact match, try searching: "20/1945"

To perform a general search with the slash escaped, try: 20//1945


Note that we are in the process of overhauling the search index implementation for 2.4, to provide users with better search results for archival descriptions. See issue #10082. I will be updating the documentation with more tips and tricks, including the above information, as we finalize the feature.

Regards,

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory

--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-users+unsubscribe@googlegroups.com.
To post to this group, send email to ica-atom-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ica-atom-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/a9a65186-9284-4eb1-9fa5-aa6b0883a0cc%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages