2
votes

I would like to use the full Lucene query syntax on an Orchard CMS based Website.

Currently, after enabling the indexing and search on Orchard, I can search on the website according to the fields I selected on the Orchard search administration page,

  • but I cannot perform one search on a particular field only (without changing the behavior on the entire search)
  • I cannot use fuzzy search...

From the logs, I can see that Orchard take care of that part (providing Lucene a good query syntax), but I would like to do it on my own. For example, when searching "wel" on the website, Orchard will send to Lucene this query : title:wel* body:wel* (if I have the title and body fields activated on the search).

I did see some blogs that talk about coding some features to customize search, but I would like to be sure I'm not missing something before switching to developer mode :)

2

2 Answers

2
votes

There are so many scenarios that can be done with search that there is no way to provide such coverage out of the box, which is why the API is very simple to use if you need custom searching capabilities.

You should copy-paste the controller from the search module and use the Parse() method of the ISearchBuilder with the escape parameter to false. This will parse a pure lucene query. You can also use the WithField("body", "value") to do simpler field search.

1
votes

I don't believe anyone has released any modules that provide additional search functionality, because if you need it, it is so simple to develop ^_^ So yes, you will have to go dev mode to do custom field search