diff --git a/_elasticsearch/media_files/search.json b/_elasticsearch/media_files/search.json deleted file mode 100644 index 9e26dfeeb6..0000000000 --- a/_elasticsearch/media_files/search.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/_elasticsearch/searches/media_files/search.json b/_elasticsearch/searches/media_files/search.json new file mode 100644 index 0000000000..e0419f181c --- /dev/null +++ b/_elasticsearch/searches/media_files/search.json @@ -0,0 +1,54 @@ +{ + "query": { + "bool": { + "must": [ + { + "bool": { + "must" : [ + { + "term": { + "media_class": "dimensional" + } + }, + { + "term": { + "media_type": "glb" + } + } + ], + "should": [ + { + "fuzzy": { + "maybe_title": { + "value": "cac", + "fuzziness": 2 + } + } + }, + { + "match": { + "maybe_title": { + "query": "cac", + "boost": 1 + } + } + }, + { + "multi_match": { + "query": "cac", + "type": "bool_prefix", + "fields": [ + "maybe_title", + "maybe_title._2gram", + "maybe_title._3gram" + ], + "boost": 50 + } + } + ] + } + } + ] + } + } +} diff --git a/_elasticsearch/searches/model_weights/search.json b/_elasticsearch/searches/model_weights/search.json new file mode 100644 index 0000000000..dada571316 --- /dev/null +++ b/_elasticsearch/searches/model_weights/search.json @@ -0,0 +1,42 @@ +{ + "query": { + "bool": { + "must": [ + { + "bool": { + "should": [ + { + "fuzzy": { + "title": { + "value": "REPLACE_ME", + "fuzziness": 2 + } + } + }, + { + "match": { + "title": { + "query": "REPLACE_ME", + "boost": 1 + } + } + }, + { + "multi_match": { + "query": "REPLACE_ME", + "type": "bool_prefix", + "fields": [ + "title", + "title._2gram", + "title._3gram" + ], + "boost": 50 + } + } + ] + } + } + ] + } + } +} \ No newline at end of file diff --git a/crates/cli/production/elasticsearch-cli/src/plans/create_dimensional_media_file_documents.rs b/crates/cli/production/elasticsearch-cli/src/plans/create_dimensional_media_file_documents.rs index 32590eca14..d4ef0c4924 100644 --- a/crates/cli/production/elasticsearch-cli/src/plans/create_dimensional_media_file_documents.rs +++ b/crates/cli/production/elasticsearch-cli/src/plans/create_dimensional_media_file_documents.rs @@ -34,6 +34,8 @@ pub async fn create_dimensional_media_file_documents( let mut cursor = 0; loop { + info!("Cursor: {cursor}"); + let results = list_media_files_for_elastic_search_backfill_using_cursor(ListArgs { mysql_pool: mysql, page_size: PAGE_SIZE, @@ -63,6 +65,8 @@ pub async fn create_dimensional_media_file_documents( ])), }).await?; + info!("Results length: {}", results.len()); + if results.is_empty() { info!("No more results at cursor {cursor}"); break; @@ -78,9 +82,9 @@ pub async fn create_dimensional_media_file_documents( } } - //for result in results { - // create_document_from_record(elasticsearch, result).await?; - //} + for result in results { + create_document_from_record(elasticsearch, result).await?; + } } Ok(())