Skip to content

Commit db50e6f

Browse files
committed
chore: change to ordered_set for improved performance
1 parent 75f7e81 commit db50e6f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/elasticlunr/core/index.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ defmodule Elasticlunr.Index do
4141

4242
name = Keyword.get_lazy(opts, :name, &UUID.uuid4/0)
4343
db_name = String.to_atom("elasticlunr_#{name}")
44-
db = DB.init(db_name, ~w[set public]a)
44+
db = DB.init(db_name, ~w[ordered_set public]a)
4545

4646
id_field = Field.new(db: db, name: ref, pipeline: Pipeline.new([IdPipeline]))
4747
fields = Map.put(%{}, to_string(ref), id_field)

test/serializer_test.exs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ defmodule Elasticlunr.SerializerTest do
88

99
structure = [
1010
"settings#name:index|ref:id|pipeline:",
11-
"db#name:elasticlunr_index|options:compressed,named_table,set,public",
11+
"db#name:elasticlunr_index|options:compressed,named_table,ordered_set,public",
1212
"field#name:id|pipeline:Elixir.Elasticlunr.Index.IdPipeline|store_documents:false|store_positions:false"
1313
]
1414

@@ -25,7 +25,7 @@ defmodule Elasticlunr.SerializerTest do
2525

2626
structure = [
2727
"settings#name:index|ref:id|pipeline:",
28-
"db#name:elasticlunr_index|options:compressed,named_table,set,public",
28+
"db#name:elasticlunr_index|options:compressed,named_table,ordered_set,public",
2929
"field#name:body|pipeline:|store_documents:true|store_positions:true",
3030
"field#name:id|pipeline:Elixir.Elasticlunr.Index.IdPipeline|store_documents:false|store_positions:false"
3131
]

0 commit comments

Comments
 (0)