Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Description parameter for full-text search #30

Merged
merged 3 commits into from
Aug 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified src/main/resources/elastic/data-dic-data.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main/resources/elastic/data-dic-types.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ UTF8_Text_Collapsed = text
UTF8_Text_Preserved = text

ASCII_Integer = integer
ASCII_NonNegative_Integer = integer
ASCII_NonNegative_Integer = long
ASCII_Numeric_Base16 = keyword
ASCII_Numeric_Base2 = keyword
ASCII_Real = double
Expand Down
10 changes: 10 additions & 0 deletions src/main/resources/elastic/default_ldds.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
PDS4_CART_1F00_1950.JSON
PDS4_DISP_1F00_1500.JSON
PDS4_GEOM_1F00_1910.JSON
PDS4_IMG_1F00_1810.JSON
PDS4_IMG_SURFACE_1F00_1240.JSON
PDS4_MSN_1F00_1300.JSON
PDS4_MSN_SURFACE_1F00_1200.JSON
PDS4_PDS_JSON_1F00.JSON
PDS4_PROC_1F00_1210.JSON
PDS4_RINGS_1F00_1A00.JSON
6 changes: 5 additions & 1 deletion src/main/resources/elastic/registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,23 @@
"vid": { "type": "float" },
"lidvid": { "type": "keyword" },

"title": { "type": "text" },
"title": {"type": "text", "analyzer": "english"},
"description": {"type": "text", "analyzer": "english"},

"product_class": { "type": "keyword" },
"archive_status": { "type": "keyword" },
"_package_id": { "type": "keyword" },

"ops:Harvest_Info/ops:node_name": { "type": "keyword" },
"ops:Harvest_Info/ops:harvest_date_time": { "type": "date" },

"ops:Label_File_Info/ops:creation_date_time": { "type": "date" },
"ops:Label_File_Info/ops:file_ref": { "type": "keyword" },
"ops:Label_File_Info/ops:file_name": { "type": "keyword" },
"ops:Label_File_Info/ops:file_size": { "type": "long" },
"ops:Label_File_Info/ops:md5_checksum": { "type": "keyword" },
"ops:Label_File_Info/ops:blob": { "type": "binary", "index": false },
"ops:Label_File_Info/ops:json_blob": { "type": "binary", "index": false },

"ops:Data_File_Info/ops:creation_date_time": { "type": "date" },
"ops:Data_File_Info/ops:file_ref": { "type": "keyword" },
Expand Down
34 changes: 34 additions & 0 deletions src/test/java/tools/LoadLdds.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package tools;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;

import gov.nasa.pds.registry.mgr.dd.LddLoader;


public class LoadLdds
{

public static void main(String[] args) throws Exception
{
LddLoader loader = new LddLoader();
loader.loadPds2EsDataTypeMap(new File("src/main/resources/elastic/data-dic-types.cfg"));

File baseDir = new File("/tmp/schema");
BufferedReader rd = new BufferedReader(new FileReader("src/main/resources/elastic/default_ldds.txt"));

String line;
while((line = rd.readLine()) != null)
{
line = line.trim();
if(line.isEmpty() || line.startsWith("#")) continue;

File file = new File(baseDir, line);
loader.load(file, null);
}

rd.close();
}

}