Extending Orchard Search and Indexing - search

We need to provide search options for users to find content based on specific field values.
We're developing a Training Course module for a client but the standard search looks for the text in any indexed field. We want to allow users to find courses based on searches against specific fields (i.e. Course Type, Location, Price, Date).
We've extended the search to check against specific fields but can't work out how to get the URL parameters passed by the Search form as a GET.
Where does Orchard put URL parameters?
Also, are we missing something, is there a way that Orchard already supports this that we haven't realized?

I would suggest you to copy part of the Search module, more specifically the Controller and the View and then modify it to suit your specific needs. I see you are actually modifying the original module, but this might be a problem on the long term, for instance if we start updating the module you might either lose you changes or have to reapply them to the code base. In the end you will target a MySiteName.Search module. And you can also add custom routes, custom settings.
On a side note the Search API is really powerful and you can even use it to do faceted search, or search on inherited taxonomy terms, tags, full text, ranges, ... Having your own controller code will let you use all of these features easily.

Related

Kentico 12 Azure Search

I'm trying to implement Azure Search on Kentico 12. Following the article below.
https://docs.kentico.com/k12/configuring-kentico/setting-up-search-on-your-website/using-azure-search/integrating-azure-search-into-pages
However, I have multiple indexes defined on the smart search not just a single index code name that I can hard code and also cannot aford to hard code index fields. Is there any tutorial out there that I can follow?
It sounds as if you're referring to building an Azure Search web part, is this correct. If so, make a property in your web part which allows you to select the code name from a list in the database. Secondly, regarding field names, you should be using generic field names like DocumentName, NodeAliaspath, etc. Although if you have very specific search results that need to be displayed, simply put in a switch statement to get the field names based on a class name.

Smart search results behaviour of compound index of multiple page types

Can someone confirm the behaviour of the Smart search results webpart when using a Smart search filter on a particular field, documentation here, when the index, and the expected results, are compound of multiple page types?
In my scenario I have 2 page types, one is always a child of the other, my hypothetical scenario would be a Folder and File types as an example.
I've configured the index with Pages type and Standard analyzer to include all Folder and File types under the path /MyOS/% on the tree.
The search page, includes the Smart search results webpart and a Smart search filter, a checkbox for the File's field FileIsHidden.
What I'm trying to ascertain is the possibility for the results to include all folders that have a hidden field, as well as the files?
Client has a v8.2 license and now has a requirement similar to this scenario.
Thanks so much for any help in advance.
Firstly what i would do is download the latest version of LUKE, it's a lucene inspector that allows you to run queries, inspect the data, etc.
https://code.google.com/archive/p/luke/downloads
Your search indexes are in the App_Data/Modules/SmartSearch/[SearchName], now i am not sure if LUKE can query 2 indexes as the same time, however you can run hte same query against both and see if it's filtering out results one way or another.
If you are trying to query where a field must be a value, and the other page type does not have the field, it probably is filtered out. What you need to do is use the lucene syntax to say "(classname = 'cms.file' and fileonlyproperty = '' OR classname <> 'cms.file')" so to say.
You'll have to test, but say the class name is cms.file and cms.folder, and the property is FileIsHidden, i think the syntax would be:
+((FieldIsHidden:(true) and classname:('cms.file')) OR (NOT classname:('cms.file'))
But you'll have to test that.

SharePoint Document Library Column Advice Needed for a Multiple Value Field

I created a basic OOTB document library to store Word and PDF files. I have been tasked to also create a few columns to store some basic metadata about the uploaded documents, for example: AuthorFirstName, AuthorLastName, and a column that lists "topics" discussed in the document.
While I am generally familiar with most Document Library settings, and creating columns, I am seeking information on what column datatype might work best for "topics". In most situations, one uploaded document would have 1-4 topics.
I would rather the datatype not be a single line of text datatype, as I would rather not ask the user to separate the different values (topics) using a delimiter such as a comma or semicolon. I would like to offer users the option to sort or filter in the SharePoint views.
There also seem to be some limitations with the Choice datatype.
While Choice fields seem to support Fill-In Values, when a choice is not pre-populated, they only seem to allow 1 fill-in. I would like the user to able to use a repeating-table-like interface to add a topic, and click an "add" button, and repeat, and so on.
I think in your scenario the best approach would be using managed metadata feature (http://office.microsoft.com/en-us/sharepoint-help/introduction-to-managed-metadata-HA102832521.aspx). It allows you to sort/filter library items, allows users to add new terms into metadata storage, etc.
Using a Lookup field to a custom List is something worth considering. The main advantage is that your data choices are stored separately from the main list and are easier to track and manage. The disadvantage is that you cannot easily have the user add a fill-in option as you desire. You would have to have a link from the library or the upload form to the options list where they would enter a new option separately from tagging it on the document.
Managed metadata is certainly an option as well, but it requires more overhead and sorting/filtering on that is a little trickier. Using a Lookup column is simple, although it does not meet all of your needs.

drupal search for a specific content type along with its node type for comments

I have a content type called 'ticket'; its Node type for comments is 'interaction'.
I want a search interface which searches through only these two (ticket,interaction) content-types; and output the node-link/title
Also, even though matches are found in interactions, i should be displaying the respective ticket node-link/title. (since interaction are actually the comments for the ticket node)
Can anybody please help me achieve this?
Thanks!
You should try using the Views module in conjunction with the core search module. You can create a view, filter the content type to ticket, and then add an exposed "Search: Search Terms" filter to your view.
Of course you could also write a quick custom module and do your own query.

How to use custom attribute in default search in Magento?

We're migrating a custom site to Magento Community, and are discovering that the default search isn't that great.
Eg searching for "shirts" will not find a product called shirt.
I'm using Like, and would prefer to keep doing so.
Yes we could monitor internal searches and create synonyms for them, but we would prefer to be proactive.
The old site had a specific field for search keywords, which they would prefer to keep using.
Is there a way of either:
a. including an attribute by default in all searches? we would define a new attribute for all products
b. or using the existing meta keywords tag as a list of keywords we would like the internal search to use?
You can change weather or not an attribute is used for searches in the admin.
catalog -> attributes -> edit
then you can enable the attribute to be used in searches.
Try to change the Search Type from like to fulltext
Configuration -> Catalog -> Catalog Search.

Resources