Searching in Liferay document library by document extension - search

I was developing a module for advanced search over liferay content, and I was stuck in document library search, it was asked to search in documents by document type, and I wish to know the feasibility of such feature, I've check liferay code and found that the document library indexer does not index the document extension instead it indexes the whole file name
Kindly help me with this issue

If you are using 6.0 or higher, you can change the way a document is indexed by using a hook plugin.
Simply define in your liferay-hook.xml
<indexer-post-processor>
<indexer-class-name>com.liferay.portal.model.DLFileEntry</indexer-class-name>
<indexer-post-processor-impl>com.example.hook.indexer.DLFileEntryIndexerPostProcessor</indexer-post-processor-impl>
</indexer-post-processor>
In your post processor class extend com.liferay.portal.kernel.search.BaseIndexerPostProcessor and implement the method you need to change up.
In this case you would want to implement postProcessDocument to add in the extension as a indexed field and also postProcessSearchQuery or postProcessFullQuery to include it as part of the search query.

Related

dynamic crm search in notes text

I want to enable quick search on records and include regarding notes on that search.
I am able to do it through advanced find but look for a way to it with quick search.
I am using dynamic crm 2013 on premise.
Any suggestions for that issue ?
Thank you,
My suggestion is to create a custom quickfind search page and attach it to the sitemap.
Inside the search page you can easily get the actual entity quickfind fetch and layout xml or create your custom advance find query and tailor the results into an advanced find iframe.

Search a specific search of a journal article based on the user type

I have this requirement:
We have a journalarticle and we wish to have sections which have content for internal and external users for the application.
We are able to hide the content from rendering by implementing custom template on web content display and using a simple custom-field for a user which helps us to classify it.
Having said that when we search something as an external user, the search portlet is able to fetch an article where the search text is a part of internal user content, and due to the above mentioned template the content is not visible.
In short, from the user's perspective the resultant article does not match the searched term.
I wish to seek some pointer to check whether there is a mechanism to ensure that when an external user searches something then we only search the dynamic-element of the doc which matches the user type?
We have thousands of such articles and create multiple copy of the same article does not seems viable solution.. so any pointers would be a great help.
Liferay version : 6.2 GA4 CE
Thanks!
AJ
First of all: Not finding a search term in a document can be a sign of good working synonym resolution in the search engine. It's questionable if this behaviour is always wrong or only in this particular case. Remember google bombs?
That being said, I believe that this architecture of half-visible documents is flawed from the beginning. Ideally I'd suggest to change it, for example by splitting the information to two articles, so that you can use the standard permissions to resolve. If you link both, you can determine how/which article or template to use. It's not an ideal solution, but might be a workaround.
Another workaround might be to change Liferay's indexer component and index two different versions of the article, with two different permissions. Of course, you'll have to change the search side as well, so that you'll find each article at most once, even if it's now twice in the search engine.
Again - not ideal, but might be the quickest fix that you can get right now without changing the underlying architecture. However, to change the underlying architecture is my actual recommendation.

Kentico smart search with custom web part

I have custom web part registered in Kentico web page and I would like to use Kentico smart search to search information from web part.
My custom web part contains grid view with following columns
Item Code
Item Name
Item Price
Mfg. Date
If user is going to enter "Laptops" in search box then system should search information based on Item Name.
Can anyone give me brief idea about Kentico smart search which satisfy above functionality?
Have you tried using the smart search index and set it to be the document crawler? In this case the crawler will index the HTML output of the pages - including the output of the web part.
I think you have a fundamental misunderstanding of how smart search operates.
Basically you'll use Smart search to index your database.
You can then use Kentico's Smart search API to filter a dataset to be used to bind into a repeater or datalist of some type.
The only thing I can suggest is consulting the Kentico documentation for your version of Kentico, specifically looking for smart search. If you included more information such as the Kentico version and the source of your data (documents, custom tables, etc) then someone may be able to give a clearer answer.

How to use lucene query syntax on Orchard CMS

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 :)
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.
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

How to search through custom component files and reference mysql tables for Joomla's front-end com_search component?

I'm using Joomla 1.5 and I'm trying to get the search component in the front-end to reference my custom components, not those just through com_content and com_newsfeeds, etc. A lot of my custom components get data from MySQL so it would help even more if I were able to add the tables for com_search to go through as well (in addition to referencing the actual file for the component itself, where the static HTML surrounding the PHP tags are written). Has anybody tried doing this?
Looks like you need to create search plugin, which will do search through your own component. Check this:
http://docs.joomla.org/Creating_a_search_plugin
Also, would be helpfull to look on default joomla search plugins. They are stored there
\plugins\search\
I hope it will be helpfull.

Resources