isomorfeus-ferret 0.14.2 → 0.14.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2821c4f4967a8af0c4f6e00a4c256754b77da083fbe5dab47e0eeac705561f01
|
4
|
+
data.tar.gz: 79c06afc07045bbe7048fa0c570384d8ead0b8fe351dde4829a26e1a1b1bde73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fc4e106796d397bdc359af7d7b42120c143cbd93e57a9cb71f1e0ca5e89f9856bc6897eb39e4358cfa0c97d77b104c6a818b4c5aaafaebdb0da2efbca00546a
|
7
|
+
data.tar.gz: 6002e45cd95bf3eb0f258ee209c783f4f4eb966068009cc76de35ad9b4a0f4a03a41180655d6d79d40a86151fe3e663b57ad79c604184eac134adfaa425153e8
|
@@ -2711,7 +2711,7 @@ void frt_tir_close(FrtTermInfosReader *tir) {
|
|
2711
2711
|
*
|
2712
2712
|
****************************************************************************/
|
2713
2713
|
|
2714
|
-
static FrtTermWriter *
|
2714
|
+
static FrtTermWriter *frt_tw_new(FrtStore *store, char *file_name) {
|
2715
2715
|
FrtTermWriter *tw = FRT_ALLOC_AND_ZERO(FrtTermWriter);
|
2716
2716
|
tw->os = store->new_output(store, file_name);
|
2717
2717
|
tw->last_term = FRT_EMPTY_STRING;
|
@@ -2736,9 +2736,9 @@ FrtTermInfosWriter *frt_tiw_open(FrtStore *store, const char *segment, int index
|
|
2736
2736
|
tiw->last_index_ptr = 0;
|
2737
2737
|
|
2738
2738
|
strcpy(file_name + segment_len, ".tix");
|
2739
|
-
tiw->tix_writer =
|
2739
|
+
tiw->tix_writer = frt_tw_new(store, file_name);
|
2740
2740
|
strcpy(file_name + segment_len, ".tis");
|
2741
|
-
tiw->tis_writer =
|
2741
|
+
tiw->tis_writer = frt_tw_new(store, file_name);
|
2742
2742
|
strcpy(file_name + segment_len, ".tfx");
|
2743
2743
|
tiw->tfx_out = store->new_output(store, file_name);
|
2744
2744
|
frt_os_write_u32(tiw->tfx_out, 0); /* make space for field_count */
|
@@ -851,6 +851,34 @@ module Isomorfeus
|
|
851
851
|
end
|
852
852
|
end
|
853
853
|
|
854
|
+
# Exports the data of the stored fields as documents to a jsonl-formatted file
|
855
|
+
def export_to_jsonl(file_name)
|
856
|
+
count = 0
|
857
|
+
File.open(file_name, 'wt') do |f|
|
858
|
+
each do |doc|
|
859
|
+
json = Oj.dump(doc.to_h, mode: :strict)
|
860
|
+
f.write(json + "\n")
|
861
|
+
count += 1
|
862
|
+
end
|
863
|
+
end
|
864
|
+
count
|
865
|
+
end
|
866
|
+
|
867
|
+
# Imports documents from a jsonl-formatted file
|
868
|
+
def import_from_jsonl(file_name)
|
869
|
+
count = 0
|
870
|
+
File.open(file_name, 'rt') do |f|
|
871
|
+
f.each_line do |json|
|
872
|
+
unless json.empty?
|
873
|
+
doc = Oj.load(json, mode: :strict)
|
874
|
+
add_document(doc)
|
875
|
+
count += 1
|
876
|
+
end
|
877
|
+
end
|
878
|
+
end
|
879
|
+
count
|
880
|
+
end
|
881
|
+
|
854
882
|
protected
|
855
883
|
def ensure_writer_open()
|
856
884
|
raise "tried to use a closed index" if not @open
|
data/lib/isomorfeus-ferret.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
+
require 'monitor'
|
2
|
+
require 'oj'
|
1
3
|
require 'isomorfeus_ferret_ext'
|
2
4
|
require 'isomorfeus/ferret/version'
|
3
5
|
require 'isomorfeus/ferret/field_symbol'
|
4
6
|
require 'isomorfeus/ferret/stdlib_patches'
|
5
|
-
require 'monitor'
|
6
7
|
require 'isomorfeus/ferret/index/field_infos'
|
7
8
|
require 'isomorfeus/ferret/index/index'
|
8
9
|
require 'isomorfeus/ferret/document'
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isomorfeus-ferret
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oj
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
20
|
-
type: :
|
19
|
+
version: 3.13.14
|
20
|
+
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 3.13.14
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|