Adding a LIKE Finder on a Localized column in Liferay Service Builder - liferay

I have a column that have been set to Localized="true", is there a way to add a finder that only matches LIKE on specific locale?

Unfortunately, I don't think it would be possible: localized columns are stored as xml strings in db, and I haven't found any example of a search like this in Liferay source. Have you considered using the index? It would be way easier to do a LIKE query for a localized field.

You can use xPath (if you use a db engine that supports it, for example postgresql)

Related

It's possible to search cql by Url confluence page

I'm using a cql search on my project, and on the search i use the default search and also searching by keyword title or text of the page context.
But i made some research to see if is possible to search by URL project and i saw like it's possible to search by Id, but i don't see nothing about URL. It's possible in some way? using CQL, or another way?

No result if search contains dot and wildcard

I use azure search and have some document with a field like this {"Nr": "123.334.93"}.
If i search for querytype=full&search=123.334.93 then it found multiple document and if I search for querytype=full&search="123.334.93" then it found one document. This is as expected.
But if I search for querytype=full&search=123.334.9* I expect multiple document starting with 123.334.9 but none result are given back.
Do I miss somthing?
The same is when I use a regex expression like this querytype=full&search=/123\.334\.9.*/
Your query looks correct to me and should work.
A couple of things you might look into.
1) Sometimes you need to escape the * like this:
querytype=full&search=123.334.9\*
Usually, this is only necessary if you have more search terms after the *.
2) You can also narrow the fields searched down to only the field you need (for better efficiency) like this:
querytype=full&search=Nr:123.334.9\*
Hope this helps.
Based on the Comment from Yahnoosh.
The analyzer of the field was set to "de.microsoft". I change that to "standard.lucene", recreate and fill the index and it works as expected.
It seems that I have to be more carefully to set the analyzer and only use specific ones for fields with language specific content.
Thanks for your help.

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

Multi language support in JSF

Is it possible to create multi language web pages with database resource?
Instead of "messages_EN.properties", "messages_HU.properties", and so on... I'd like to keep those texts in database. Is it possible to use this in the same way as properties files? For instance #{messages.hello} would depend on the current users language, and the text would be loaded from database, not properties file.
First you should check this:
Correct java.util.ResourceBundle Organization
The way to do it is described here:
messages.properties taken from db

When to use which search technique in Sharepoint development?

When I have to use KeywordSearchQuery, when should I use FullTextSearchQuery and when should I use Query in developing the search part in Visual Studio for a Sharepoint site?
I want to search information from Contact list. If any keyword is put in the search box, I wan related information in our own specified format. Which technique should I use?
I think it depends on the situation. In your case, since you are searching a Contacts list, I would recommend using a regular CAML and SPQuery.
In general:
One list, use a CAML query
Many lists, use search

Resources