Giter Club home page Giter Club logo

Comments (4)

AliOsm avatar AliOsm commented on June 2, 2024 1

I just found the issue. I created a meilisearch ruby client and tried to add a document to the index by hand as follows:

require 'meilisearch'

client = MeiliSearch::Client.new('http://127.0.0.1:7700', 'key')
index = client.index('Hadith')
index.add_documents([{id: 1, searchable_text: 'test', author: 'test', hadith_book_id: 1, source: 'lk'}])

Then, when I checked the tasks I found the following issue:

client.tasks

# The primary key inference failed as the engine found 2 fields ending with `id` in their names: 'id' and 'hadith_book_id'. Please specify the primary key manually using the `primaryKey` query parameter.

So, I changed hadith_book_id to hadith_book by defining the attribute as a block and the issue resolved.

I think I can use primary_key: :id with meilisearch block, but this works for now :)

from meilisearch-rails.

AliOsm avatar AliOsm commented on June 2, 2024

One difference, in development I'm using the latest meilisearch docker image, while in production I'm using v1.1.1, could this be the issue?

from meilisearch-rails.

AliOsm avatar AliOsm commented on June 2, 2024

I tried with v1.1.1 on development and it works fine.

from meilisearch-rails.

AliOsm avatar AliOsm commented on June 2, 2024

Other observation is when I run Hadith.reindex! it takes minutes before finish, which means there is a process happens behind the scene, but I can't see any logs.

from meilisearch-rails.

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.