Bibliome / alvisir

AlvisIR semantic search engine
Apache License 2.0
6 stars 2 forks source link

Parsing of `not` is off #24

Open rbossy opened 3 years ago

rbossy commented 3 years ago

https://forgemia.inra.fr/claire.nedellec/alvisir-biotope/-/issues/3

curl -o foo.xml 'http://bibliome.jouy.inra.fr/demo/ontobiotope/alvisir2/webapi/search?q=valve+not+aortic+not+heart'
  <query default-field="contents">
    <query-string>valve not aortic not heart</query-string>
    <original-query>
      <and>
        <term>valve</term>
        <and operator="but">
          <term operator="but">aortic</term>
          <term operator="but">heart</term>
        </and>
      </and>
    </original-query>
    <expanded-query>
      <and>
        <term>valv</term>
        <and operator="but">
          <term operator="but">aortic</term>
          <or operator="but">
            <prefix>{habitat}/obt:000001/obt:000014/obt:000039/obt:000231/obt:002713/</prefix>
            <prefix>{habitat}/obt:000001/obt:000014/obt:000039/obt:000364/obt:002713/</prefix>
          </or>
        </and>
      </and>
    </expanded-query>
    <lucene-query>+((title:valv abstract:valv)~1) -(-((title:aortic abstract:aortic)~1) -((((title:{habitat}/obt:000001/obt:000014/obt:000039/obt:000231/obt:002713/* abstract:{habitat}/obt:000001/obt:000014/obt:000039/obt:000231/obt:002713/*)~1) ((title:{habitat}/obt:000001/obt:000014/obt:000039/obt:000364/obt:002713/* abstract:{habitat}/obt:000001/obt:000014/obt:000039/obt:000364/obt:002713/*)~1))~1))</lucene-query>
  </query>