Searching an indexed Image in LIRE Solr Integration Project

254 views
Skip to first unread message

Jags

unread,
Apr 17, 2018, 12:15:05 PM4/17/18
to lire-dev
Dear Fellows,
I am trying the LIRE Solr Integration project going through from this link https://github.com/dermotte/liresolr.
I am not getting how to make the search passing the image URL as parameter or passing the image path as parameter.

I have successfully indexed the images and a simple 1 record search returns the below result


Response:
{
  "responseHeader":{
    "status":0,
    "QTime":1,
    "params":{
      "rows":"1"}},
  "response":[
    {
      "id":"/DataImages/hr180314/878292/87829291/00000002.JPG",
      "title":["/DataImages/hr180314/878292/87829291/00000002.JPG"],
      "eh_hi":"ooCwgZOSkKGRk7G1xoGzwKGlkcLRssaBw8GkxZOkgYCQgYCgkZCQkA==",
      "eh_ha":"dd7 a64 8e0 23e 6a6 826 f03 892 48 207 be9 4c1 956 5a6 297 810 e8 c1e b1e 68e a76 a5d bc7 273 61e 2e 4f0 60 759 c72 b92 6fb ef3 eb 350 78f c02 705 d61 5d cdb b45 f73 f94 a12 3dc 4ec 739 a3b ed1 ab3 bbb fb2 aac 11d 811 7cd b02 f2b 4ca ebc 9a9 328 cfb 775 263 e11 8b1 ea4 f08 138 72d 84c cc5 f52 97 6ca 692 dd4 a98 9cf f6e 50e 2f2 7d5 e51 49b df8 13f add 8f0 c18 f01 651 fad c73 c25 82f 466 798",
      "ph_hi":"xKKioqKiov/RkaKks7Ok9rS...

I want to pass the image that I need to search as a URL or as a local path in the request URL which will basically extract data from the image based on the feature and return the matching records from solr.
What is the format/syntax of the request URL? Please provide me some pointers.

Thank you in advance.
Jags

Mathias Lux

unread,
Apr 17, 2018, 2:44:13 PM4/17/18
to lire-dev
Hi!

The params needed are described here: https://github.com/dermotte/liresolr#search-by-url

regards,
Mathias

--
Sie erhalten diese Nachricht, weil Sie in Google Groups E-Mails von der Gruppe "lire-dev" abonniert haben.
Wenn Sie sich von dieser Gruppe abmelden und keine E-Mails mehr von dieser Gruppe erhalten möchten, senden Sie eine E-Mail an lire-dev+unsubscribe@googlegroups.com.
Weitere Optionen finden Sie unter https://groups.google.com/d/optout.



--
Priv.-Doz. Dr. Dipl.-Ing. Mathias Lux
Associate Professor at Klagenfurt University, Austria
http://tinyurl.com/mlux-itec ... contact and cv

LIRE image search engine - http://www.lire-project.net

Jags

unread,
Apr 18, 2018, 9:28:24 AM4/18/18
to lire-dev
Thanks for the Response.
When I try that, gives below error. Am I missing something ? I am using the liresolr-master.zip downloaded on 3/22 from https://github.com/dermotte/liresolr


Problem accessing /solr/lire/lireq. Reason:

    Server Error

Caused by:

java.lang.NoSuchFieldError: totalHits
	at net.semanticmetadata.lire.solr.LireRequestHandler.doSearch(LireRequestHandler.java:537)


Wenn Sie sich von dieser Gruppe abmelden und keine E-Mails mehr von dieser Gruppe erhalten möchten, senden Sie eine E-Mail an lire-dev+u...@googlegroups.com.

Weitere Optionen finden Sie unter https://groups.google.com/d/optout.

Jags

unread,
Apr 18, 2018, 9:35:09 AM4/18/18
to lire-dev

Mathias Lux

unread,
Apr 18, 2018, 10:06:54 AM4/18/18
to lire-dev
Hi!

Are you sure to have indexed cl_ha?

regards,
mathias

Wenn Sie sich von dieser Gruppe abmelden und keine E-Mails mehr von dieser Gruppe erhalten möchten, senden Sie eine E-Mail an lire-dev+unsubscribe@googlegroups.com.

Weitere Optionen finden Sie unter https://groups.google.com/d/optout.

Jags

unread,
Apr 18, 2018, 10:12:53 AM4/18/18
to lire-dev
This is what i have in my managed-schema


<!-- lire solr --> <fieldtype name="binaryDV" class="net.semanticmetadata.lire.solr.BinaryDocValuesField"/> <!-- the title of the image, e.g. the file name, optional --> <field name="title" type="text_general" indexed="true" stored="true" multiValued="true"/> <!-- the url where the image is to be downloaded, optional --> <field name="imgurl" type="string" indexed="true" stored="true" multiValued="false"/> <field name="eh_hi" type="text_ws" indexed="true" stored="true"/> <field name="ph_hi" type="text_ws" indexed="true" stored="true"/> <field name="cl_hi" type="text_ws" indexed="true" stored="true"/> <field name="jc_hi" type="text_ws" indexed="true" stored="true"/> <field name="cl_ha" type="text_ws" indexed="true" stored="true"/> <field name="eh_ha" type="text_ws" indexed="true" stored="true"/> <field name="ph_ha" type="text_ws" indexed="true" stored="true"/> <field name="jc_ha" type="text_ws" indexed="true" stored="true"/> <!-- Dynamic fields for LIRE Solr --> <dynamicField name="*_ha" type="text_ws" indexed="true" stored="true"/> <!-- if you are using BitSampling --> <dynamicField name="*_ms" type="text_ws" indexed="true" stored="true"/> <!-- if you are using Metric Spaces Indexing --> <dynamicField name="*_hi" type="binaryDV" indexed="false" stored="true"/> <!-- lire solr: till here -->

Thanks
Jags

Mathias Lux

unread,
Apr 18, 2018, 10:35:22 AM4/18/18
to lire-dev
And the indexer generated the fields for you? that's the critical part.

regards,
Mathias

--
Sie erhalten diese Nachricht, weil Sie in Google Groups E-Mails von der Gruppe "lire-dev" abonniert haben.
Wenn Sie sich von dieser Gruppe abmelden und keine E-Mails mehr von dieser Gruppe erhalten möchten, senden Sie eine E-Mail an lire-dev+unsubscribe@googlegroups.com.
Weitere Optionen finden Sie unter https://groups.google.com/d/optout.

Jags

unread,
Apr 18, 2018, 10:59:44 AM4/18/18
to lire-dev
Mathias,
This is the directory structure i have

C:\solr-6.4.0
    bin
    dist (contains solr jars)
    liresolr-master
        dist
            lire.jar
            liresolr.jar
        lib
            LIRE-1.0_b04.jar

Wondering if there is a conflict..?
 

Mathias Lux

unread,
Apr 18, 2018, 11:42:29 AM4/18/18
to lire-dev
well, that depends on the class path you use for running it, no way for me to infer this from the directory structure. 

cheers,
mathias

--
Sie erhalten diese Nachricht, weil Sie in Google Groups E-Mails von der Gruppe "lire-dev" abonniert haben.
Wenn Sie sich von dieser Gruppe abmelden und keine E-Mails mehr von dieser Gruppe erhalten möchten, senden Sie eine E-Mail an lire-dev+unsubscribe@googlegroups.com.
Weitere Optionen finden Sie unter https://groups.google.com/d/optout.

Jags

unread,
Apr 18, 2018, 1:17:39 PM4/18/18
to lire-dev
Yes, I executed this command to to index the data..

C:\solr-6.4.0\liresolr-master\build\classes\main>java -cp lire.jar;liresolr.jar net.semanticmetadata.lire.solr.indexing.ParallelSolrIndexer -i C:\DataImages\testImages\testImages_infile.txt -o C:\DataImages\testImages\testImages_outfile.xml -f -p

C:\solr-6.4.0\liresolr-master>java -Dtype=text/xml -Dc=lire -jar post.jar C:\DataImages\testImages\testImages_outfile.xml 
Thanks
Jags

Jags

unread,
Apr 18, 2018, 2:06:52 PM4/18/18
to lire-dev
Mathias,
Here is the one of the row query result snippet looks like, showing the generated field values.


"responseHeader":{
    "status":0,
    "QTime":6,
    "params":{
      "rows":"1"}},
  "response":[
    {
      "id":"/TrademarkApplicationDataImages/hr180314/878286/87828635/00000002.JPG",
      "title":["/TrademarkApplicationDataImages/hr180314/878286/87828635/00000002.JPG"],
      "eh_hi":"kYGSkYGhkJCQgcGitJGy0ZGUkbSiksGRo6GCtJOjgICAgICAgICBkg==",
      "eh_ha":"dc7 e45 a0 21d 6a4 aa7 743 ...",
      "ph_hi":"5qKhoqLTwv/hs7KiorOWxZKRoaLj0v/hsrGiorOW9pGR ...",
      "ph_ha":"ac7 dc6 6e ca1 ...",
      "cl_hi":"FQY4DwwZDg4PERAREQ8RDhEPDw8QDxAgEBAQEBAgEBAQEBA=",
      "cl_ha":"893 2c5 ce6 b55 ..",
      "jc_hi":"DQbqAwbqAgLqCg3pAuoECOoCBOo=",
      "jc_ha":"11b 25c 887 f8d 9..."
}]}


Any pointers..?

Thanks
Jags

On Wednesday, April 18, 2018 at 10:35:22 AM UTC-4, Mathias Lux wrote:

Jags

unread,
Apr 18, 2018, 2:16:18 PM4/18/18
to lire-dev
Classpath set in the solrconfig.xml

<lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib" regex=".*\.jar" /> <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-cell-\d.*\.jar" /> <lib dir="${solr.install.dir:../../../..}/contrib/clustering/lib/" regex=".*\.jar" /> <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-clustering-\d.*\.jar" /> <lib dir="${solr.install.dir:../../../..}/contrib/langid/lib/" regex=".*\.jar" /> <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-langid-\d.*\.jar" /> <lib dir="${solr.install.dir:../../../..}/contrib/velocity/lib" regex=".*\.jar" /> <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-velocity-\d.*\.jar" />

so lire jar should be included here, right ?

Thanks
Jags

Jags

unread,
Apr 18, 2018, 2:26:24 PM4/18/18
to lire-dev
Sorry missed it, i also have this line in solrconfig.xml :    C:\solr-6.4.0\liresolr-master\dist\liresolr.jar

Is this good enough or should i include lire.jar as well ?

Thanks 
Jags

Jags

unread,
Apr 20, 2018, 3:58:13 PM4/20/18
to lire-dev
          java.lang.NoSuchFieldError: totalHits
	at net.semanticmetadata.lire.solr.LireRequestHandler.doSearch(LireRequestHandler.java:537)

Planning to tryout with a fresh copy of solr and LIRE.

Thank you in advance..
Jags

Jags

unread,
Apr 23, 2018, 12:25:41 PM4/23/18
to lire-dev

Problem accessing /solr/lire/lireq. Reason:

    Server Error

Caused by:

java.lang.NoSuchFieldError: totalHits
	at net.semanticmetadata.lire.solr.LireRequestHandler.doSearch(LireRequestHandler.java:537)
	at net.semanticmetadata.lire.solr.LireRequestHandler.handleUrlSearch(LireRequestHandler.java:361)
	at net.semanticmetadata.lire.solr.LireRequestHandler.handleRequestBody(LireRequestHandler.java:155)
	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:166)
	at org.apache.solr.core.SolrCore.execute(SolrCore.java:2306)
	at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:658)

Here are my configuration updates:

solrconfig.xml:

     <lib dir="${solr.install.dir:../../../..}/contrib/lire/lib" regex="LireSolr-6.4.0_b01.jar" />

      <requestHandler name="/lireq" class="net.semanticmetadata.lire.solr.LireRequestHandler">
       <lst name="defaults">
          <str name="echoParams">explicit</str>
          <str name="wt">json</str>
          <str name="indent">true</str>
       </lst>
      </requestHandler>
      
     <valueSourceParser name="lirefunc" class="net.semanticmetadata.lire.solr.LireValueSourceParser" />

managed-schema:
    <fieldtype name="binaryDV" class="net.semanticmetadata.lire.solr.BinaryDocValuesField"/>

    <dynamicField name="*_ha" type="text_ws" indexed="true" stored="false"/> <!-- if you are using BitSampling --> 
    <dynamicField name="*_ms" type="text_ws" indexed="true" stored="false"/> <!-- if you are using Metric Spaces Indexing -->
    <dynamicField name="*_hi" type="binaryDV" indexed="false" stored="true"/>

Lire Solr jars version:
C:\liresolr-master\lib\LIRE-1.0_b04.jar  
C:\liresolr-master\build\libs\LireSolr-6.4.0_b01.jar

Indexing steps followed:
  1.  C:\DataImages>dir /s /b *.jpg > infile.txt

   2. C:\liresolr-master>java -cp ./lib/LIRE-1.0_b04.jar;./build/libs/LireSolr-6.4.0_b01.jar net.semanticmetadata.lire.solr.indexing.ParallelSolrIndexer -i C:\DataImages\infile.txt -o  C:\DataImages\outfile.xml -f -p

   3.  C:\solr-6.4.0>java -Dtype=text/xml -Dc=lire -jar ./example/exampledocs/post.jar C:\DataImages\outFile.xml

Simple Query results:

 
{"responseHeader":{"status":0,"QTime":0,"params":{"q":"*:*","wt":"json"}},"response":{"numFound":1857,"start":0,"docs":[{"id":"/TrademarkApplicationDataImages/hr180314/878286/87828623/00000002.JPG","title":["/TrademarkApplicationDataImages/hr180314/878286/87828623/00000002.JPG"],"eh_hi":"","ph_hi":"","cl_hi":"","jc_hi":"","_version_":1598552319708889088},{"id":"/TrademarkApplicationDataImages/hr180314/878259/87825988/00000002.JPG","title":["/TrademarkApplicationDataImages/hr180314/878259/87825988/00000002.JPG"],"eh_hi":"","ph_hi":"","cl_hi":"","jc_hi":"","_version_":1598552319741394944},...

See if you can let me know if I missed anything ? 

Thank you,
Jags







Jags

unread,
Apr 24, 2018, 2:32:25 PM4/24/18
to lire-dev
Finally, I was able to resolve this issue and got the search results.. 

 I was using the liresolr-master.zip version, replaced with liresolr-6.4.0-last.zip version and changed 1 parameter in the search URL

Wanted to close this topic..!!

Thank you Mathias for your pointers..

Regards,
Jags
Reply all
Reply to author
Forward
0 new messages