Giter Club home page Giter Club logo

Comments (4)

cgravier avatar cgravier commented on June 8, 2024

I can add that mapping and query seems OK, since when I add a second document (PDF in this case) with the same previous method, i.e.:

coded=`cat download/sherlock_holmes.pdf | perl -MMIME::Base64 -ne 'print encode_base64($_)'`
echo "{\"file\":\"${coded}\"}" > sk-b64.json
curl -X POST "localhost:9200/myepubcontents/books" -d @sk-b64.json

I can query again elastic search, the two docuemtns hits, but the PDF is fetched along its date, author, and title, while the epub is not :

curl -XGET 'http://localhost:9200/myepubcontents/books/_search?pretty=true&explain=false' -d '{ "fields" : [ "title", "author", "date" ],
>    "query": {
>       "query_string" : {
>          "fields" : [ "file" ],
>          "query" : "a*",
>          "use_dis_max" : true }
>    },
>    "highlight" : {
>       "fields" : {
>          "file" : {}
>       }
>     }
> }'
{
  "took" : 79,
  "timed_out" : false,
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "failed" : 0
  },
  "hits" : {
    "total" : 2,
    "max_score" : 1.0,
    "hits" : [ {
      "_index" : "myepubcontents",
      "_type" : "books",
      "_id" : "dcHGZRSPRZW_JjpHJ4S7QQ",
      "_score" : 1.0,
      "fields" : {
        "file.date" : "2011-02-22T02:08:19.000Z",
        "file.author" : "Arthur Conan Doyle",
        "file.title" : "The Adventures of Sherlock Holmes"
      },
      "highlight" : {
        "file" : [ " of \n\nit. \n\n\"Eight weeks passed <em>away</em> like this, and I had written <em>about</em> <em>Abbots</em> and <em>Archery</em> and \n\n<em>Armour</em>", " and predominates the whole of her \n\nsex. It was not that he felt <em>any</em> emotion <em>akin</em> to love for Irene <em>Adler</em>. <em>All</em>", ". They were <em>all</em> three standing in a knot in front of the \n\n<em>altar</em>. I lounged up the side <em>aisle</em> like <em>any</em>", " the <em>acquaintance</em> of the well-known <em>adventuress</em>, Irene <em>Adler</em>. The name is no \n\ndoubt familiar to you.\" \n\n\"Kindly", " to.\" \n\n\"And what of Irene <em>Adler</em>?\" I <em>asked</em>. \n\n\"Oh, she has turned <em>all</em> the men's heads down in that part. She" ]
      }
    }, {
      "_index" : "myepubcontents",
      "_type" : "books",
      "_id" : "-oggjyFPQFqrMh3kN9giDw",
      "_score" : 1.0,
      "highlight" : {
        "file" : [ " numbers.\n<em>Also</em>, in real computers, <em>arithmetic</em> operations are <em>almost</em> <em>always</em>\nperformed with limited", " we are <em>asked</em> to <em>apply</em> the procedure to some\n<em>argument</em>, we first look to see if the value is <em>already</em>", " <em>advantages</em>, however.  One of\nthem is that it can <em>accommodate</em> procedures that may take an <em>arbitrary</em>", "\n\n\n\n\n\n\nNo <em>ambiguity</em> can <em>arise</em>, because the operator is <em>always</em> the leftmost\nelement and the entire", " <em>appear</em> in\n<em>any</em> powerful programming language:\n\n\n\n\n\n\n\n\n\t\tNumbers and <em>arithmetic</em> operations are\nprimitive" ]
      }
    } ]
  }
}

from elasticsearch-mapper-attachments.

spinscale avatar spinscale commented on June 8, 2024

the tika version used in the plugin seems to be 1.2 - maybe support for epub has been added later?

from elasticsearch-mapper-attachments.

dadoonet avatar dadoonet commented on June 8, 2024

I tested it with the current version in master (with Tika 1.4) and get it worked.
The issue is not about Tika version but you hit the max length (default to 100000).

You need to increase that value in order to get all content (including metadata as well).

I set for example "index.mapping.attachment.indexed_chars":-1 and get all expected metadata.

from elasticsearch-mapper-attachments.

cgravier avatar cgravier commented on June 8, 2024

Thanks for the tip !

from elasticsearch-mapper-attachments.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.