Coder Social home page Coder Social logo

meilisearch-elixir's People

Contributors

andykent avatar awea avatar blitzbanana avatar calamari avatar michaeloshosanya avatar robottokauf3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

meilisearch-elixir's Issues

Is this project still maintained?

I see no commits since September, and no-one is replying to #2. So I wanted to know if it is still maintained, and is it stable enough to be used in prod?

Add support to new versions of Meilisearch

Hi @robottokauf3, I work for Meilisearch as the Integrations team manager, and I would like to offer my help (and personal time) to help upgrade this library to support the new versions of Meilisearch.

If you think that's a good idea, we can work together to upgrade this package :)

Consider switching to `Finch` HTTP client

Thanks for creating this awesome library. Would you consider switching the HTTP client from httpoison to finch? Reasons include:

  • Finch works better in high throughput scenarios. Using Meilisearch for search as you type can definitely become high throughput. See this post on the Elixir Forum for details.
  • Finch is very popular in the Elixir community. It will even be a default dependency in the next release of Phoenix (phoenixframework/phoenix#4876).
  • I've personally been bitten by this serious bug in hackney (which httpoison is based on) which crashes the process that calls httpoison. It's quite serious and still unresolved 4 years later despite being the most upvoted issue in hackney. benoitc/hackney#464

If you're open to this then I'd be happy to submit a pull-request updating the Meilisearch.HTTP to use Finch. Thanks.

Set the Master API Key

How do you configure the master key? I didn't see it in the docs. I tried this:

config :meilisearch,
  api_key: System.get_env("MEILI_MASTER_KEY")

I'm pretty sure I'm getting that value at runtime but getting this back when I do the search: {:error, nil, :econnrefused}

meilisearch reports far fewer documents when particular map fields are included

So when I insert 12296 documents using this query below, localhost:7700 shows me 12296 items.

but if I un-comment

      # chan_uuid: c.id,
      # chan_readable_id: c.readable_id,
      # chan_name: c.name,
      # chan_description: c.description,

I see 0 items in the meilisearch web ui.

I am certain I am always passing add_or_replace() 12296 items.

I am not sure if this is related to the elixir module or not to be honest.

I am certain this join works in SQL(12296 items):

CREATE VIEW media_items_joined AS
SELECT items.id,
	items.title,
	items.artist,
	items.presenter_name,
	items.presented_at,
	items.published_at,
	items.updated_at,
	items.localizedname,
	items.language_id,
	items.source_material,
	items.description,
	items.media_category,
	items.media_format,
	items.tags,
	items.filepath,
	items.cdn_path,
	items.readable_id,
	items.duration,
	items.size_bytes,
	items.width,
	items.height,
	items.view_count,
	items.like_count,
	items.dislike_count,
	plist.id AS playlist_uuid,
	plist.readable_id AS playlist_readable_id,
	plist.name AS playlist_basename,
	chan.id AS channel_uuid,
	chan.readable_id AS channel_readable_id,
	chan.name AS channel_basename,
	org.id AS org_uuid,
	org.readable_id AS org_readable_id,
	org.basename AS org_basename,
	org.shortname AS org_shortname
FROM mediaitems AS items
LEFT JOIN playlists AS plist ON items.playlist_id = plist.id
LEFT JOIN channels AS chan ON plist.channel_id = chan.id
LEFT JOIN orgs AS org ON chan.org_id = org.id;

elixir seed.exs code follows:

alias FaithfulWord.Repo
alias FaithfulWord.Schema.{MediaItem, Playlist, Org}
alias FaithfulWord.Channels.Channel

import Ecto.Query
import Meilisearch.Indexes
import Meilisearch.Documents

Meilisearch.Indexes.delete("mediaitems")
Meilisearch.Indexes.create("mediaitems")

# returns 12296 list items

mediaitems =
  from(mediaitem in MediaItem,
  left_join: p in Playlist,
  on: mediaitem.playlist_id == p.id,
  left_join: c in Channel,
  on: p.channel_id == c.id,
  left_join: o in Org,
  on: mediaitem.org_id == o.id,
    select: %{
      id: mediaitem.id,
      readable_id: mediaitem.readable_id,
      title: mediaitem.title,
      description: mediaitem.description,
      comment: mediaitem.comment,
      tags: mediaitem.tags,
      artist: mediaitem.artist,
      media_format: mediaitem.media_format,
      media_category: mediaitem.media_category,
      source_material: mediaitem.source_material,
      presented_at: mediaitem.presented_at,
      presenter_name: mediaitem.presenter_name,
      duration: mediaitem.duration,
      size_bytes: mediaitem.size_bytes,
      cdn_path: mediaitem.cdn_path,
      view_count: mediaitem.view_count,
      like_count: mediaitem.like_count,
      dislike_count: mediaitem.dislike_count,
      playlist_uuid: p.id,
      playlist_readable_id: p.readable_id,
      playlist_name: p.name,
      playlist_description: p.description,
      # chan_uuid: c.id,
      # chan_readable_id: c.readable_id,
      # chan_name: c.name,
      # chan_description: c.description,
      org_uuid: o.id,
      org_readable_id: o.readable_id,
      org_shortname: o.shortname,
      org_basename: o.basename
    })
  |> Repo.all()

  Meilisearch.Documents.add_or_replace("mediaitems", mediaitems)

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.