mikmc commited on
Commit
6caeb01
·
verified ·
1 Parent(s): 517a7b0

Update commons/queryBuilder.js

Browse files
Files changed (1) hide show
  1. commons/queryBuilder.js +2 -4
commons/queryBuilder.js CHANGED
@@ -1,6 +1,4 @@
1
- const luceneQueryGenerator = require('lucene-query-generator');
2
-
3
- console.log("Imported lucene-query-generator:", luceneQueryGenerator);
4
 
5
  /**
6
  * Builds and formats the Lucene query for the catalog search.
@@ -29,7 +27,7 @@ module.exports = (args) => {
29
  // Generate the Lucene query string only if the query object is not empty
30
  if (Object.keys(query).length > 0) {
31
  try {
32
- return luceneQueryGenerator(query); // Corrected usage of luceneQueryGenerator
33
  } catch (error) {
34
  console.error("Error generating Lucene query:", error);
35
  return ''; // Return an empty query if generation fails
 
1
+ const { convert } = require('lucene-query-generator');
 
 
2
 
3
  /**
4
  * Builds and formats the Lucene query for the catalog search.
 
27
  // Generate the Lucene query string only if the query object is not empty
28
  if (Object.keys(query).length > 0) {
29
  try {
30
+ return convert(query); // Corrected usage of `convert`
31
  } catch (error) {
32
  console.error("Error generating Lucene query:", error);
33
  return ''; // Return an empty query if generation fails