Hi!

About bracket reduction: this is what I added to my code. It is not that simple 
as I generate them from othet ops.

I agree, that it would be a good idea if the query parser removes unnecessary 
brackets.  Would avoid trouble.

I'll try to build a sample against the demo site.

--
Kind regards,

Alexander Wagner

Subject Specialist
Central Library
52425 Juelich

mail : a.wag...@fz-juelich.de
phone: +49 2461 61-1586
Fax  : +49 2461 61-6103
www.fz-juelich.de/zb/DE/zb-fi


----- Reply message -----
From: "Tibor Simko" <tibor.si...@cern.ch>
Date: Thu, Feb 27, 2014 14:28
Subject: Search & Bracketing
To: "Wagner, Alexander" <a.wag...@fz-juelich.de>
Cc: "project-invenio-devel@cern.ch" <project-invenio-devel@cern.ch>

On Thu, 27 Feb 2014, Wagner, Alexander wrote:
> The ind:val-example I gave, where you noticed it is perfrctly ok, is
> actually broken on JuSER.

Would you have an example that fails on our demo site?

>> (ind:"val1" and ind:"val2") and ((ind:"val3" or ind:"val4") or
>> ind:"val5")

If you use this query literally, then please note that several pairs of
parentheses are not needed here, as they are chaining within the same
AND or OR sequence.  You can reduce the above to:

  ind:"val1" and ind:"val2" and (ind:"val3" or ind:"val4" or ind:"val5")

The logic being:

  (A and B) and ((C or D) or E) == A and B and (C or D or E)

It may be helpful to the query parser to always reduce the number of
incoming parentheses.

Best regards
--
Tibor Simko


------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------

Reply via email to