1

I have been using the cleo-primer from https://github.com/jingwei/cleo-primer

and have found one seriously annoying issue. For eg. see this element in my dat file( in the same format as the file).

<?xml version="1.0" encoding="us-ascii"?>
<element-list>
<element>
    <id>12205</id> 
    <score>420.000000</score> 
    <name>angel investor</name> 
    <term>angel investings</term> 
    <term>angel investing</term> 
    <term>angel investments</term> 
    <term>angel investment</term> 
    <term>angel investors</term> 
    <term>angel investor</term> 
    <term>business angel</term> 
    <term>informal investor</term> 
    <term>angel</term> 
    <term>investor</term>
</element>
</element-list>

I added this file to the cleo server using
./scripts/post-element-list.sh mydat-file.xml which uses
curl -v -X POST -H "Content-type: application/xml" -H "Accept: application/xml" http://localhost:8080/cleo-primer/rest/elements/ --data-binary
to add elements and got the output.

* STATE: INIT => CONNECT handle 0x60002e190; line 1028 (connection #-5000)
* Hostname was NOT found in DNS cache
*   Trying ::1...
* STATE: CONNECT => WAITCONNECT handle 0x60002e190; line 1076 (connection #0)
* Connected to localhost (::1) port 8080 (#0)
* STATE: WAITCONNECT => DO handle 0x60002e190; line 1195 (connection #0)
> POST /cleo-primer/rest/elements/ HTTP/1.1
> User-Agent: curl/7.37.0
> Host: localhost:8080
> Content-type: application/xml
> Accept: application/xml
> Content-Length: 4428
> Expect: 100-continue
>
* STATE: DO => DO_DONE handle 0x60002e190; line 1281 (connection #0)
* STATE: DO_DONE => WAITPERFORM handle 0x60002e190; line 1407 (connection #0)
* STATE: WAITPERFORM => PERFORM handle 0x60002e190; line 1420 (connection #0)
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 100 Continue
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 200 OK
< Content-Length: 0
* Server Jetty(6.1.25) is not blacklisted
< Server: Jetty(6.1.25)
<
* STATE: PERFORM => DONE handle 0x60002e190; line 1590 (connection #0)
* Connection #0 to host localhost left intact
* Expire cleared

So then I queried in my browser with the URL

cleo-primer/rest/elements/search?query=my_query


It gives null when queried with 'angel investments', 'angel investings'. But gives the element itself when queried with 'angel invest' or 'angel investor'. On rigorous testings I have found out that it only shows this type of null when the queried term is just a slight variant of the name in the end. Please let me know how to solve this using cleo-primer.

Saurabh
  • 492
  • 3
  • 10

0 Answers0