ncats / bard

Sources for the BioAssay Research Database
Other
10 stars 2 forks source link

Free-text search for some SMILES causes SOLR to throw exception #35

Closed jerilevine closed 11 years ago

jerilevine commented 11 years ago

This request works:

http://bard.nih.gov/api/v10/search/compounds?q=OC(=O)C1=C(O)C=CC=C1

But this request does not:

http://bard.nih.gov/api/v10/search/compounds?q=C[C@]1(O)CCC2C3CCC4=CC(=O)CC[C@]4(C)C3CC[C@]12C

This second request throws a SolrException:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

GlassFish Server Open Source Edition 3.1.2.2 - Error report
<body>
    <h1>HTTP Status 500 - </h1>
    <hr/>
    <p>
        <b>type</b> Exception report
    </p>
    <p>
        <b>message</b>
    </p>
    <p>
        <b>description</b>The server encountered an internal error () that prevented it from fulfilling this request.
    </p>
    <p>
        <b>exception</b>
        <pre>javax.servlet.ServletException: org.apache.solr.client.solrj.SolrServerException: Error executing query</pre>
    </p>
    <p>
        <b>root cause</b>
        <pre>org.apache.solr.client.solrj.SolrServerException: Error executing query</pre>
    </p>
    <p>
        <b>root cause</b>
        <pre>org.apache.solr.common.SolrException: Bad Request

Bad Request

request: http://protease.nhgri.nih.gov:8090/solr//core-compound/select?q=C[C@]1(O)CCC2C3CCC4=CC(=O)CC[C@]4(C)C3CC[C@]12C&amp;hl=true&amp;hl.snippets=1&amp;hl.fragsize=300&amp;hl.simple.pre=&lt;b&gt;&amp;hl.simple.post=&lt;/b&gt;&amp;hl.fl=text&amp;rows=10000&amp;facet=true&amp;facet.query=mw:[ TO 100]&facet.query=mw:[100 TO 200]&facet.query=mw:[200 TO 300]&facet.query=mw:[300 TO ]&facet.query=tpsa:[ TO 40]&facet.query=tpsa:[40 TO 120]&facet.query=tpsa:[120 TO 180]&facet.query=tpsa:[180 TO ]&facet.query=xlogp:[ TO 1]&facet.query=xlogp:[1 TO 3]&facet.query=xlogp:[3 TO 5]&facet.query=xlogp:[5 TO ]&facet.mincount=1&facet.field=compound_class&wt=javabin&version=2

note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 3.1.2.2 logs.

    <hr/>
    <h3>GlassFish Server Open Source Edition 3.1.2.2</h3>
</body>

rajarshi commented 11 years ago

Working in v12 and straw (though as discussed in a separate thread, text search using SMILES is not encouraged and the results not guaranteed)

jerilevine commented 11 years ago

Noted. We will work to put in a regex on our side that will catch SMILES and treat it as a compound search.