xpages partial - full search

若如初见. 提交于 2019-12-11 03:18:33

问题


I saw a great tutorial from IBM explaining creating a search modulo into a view panel.

The code from the viewpanel ( search property ) I adjusted:

 "(Field txt_autor = \"" + sessionScope.searchAutor + "\")";
    }

Is there any chance I can modify the code so that it offers the search results for the partial string matches also, for example: if Autor = Smith and in the string searchAutor = Smit currently I get 0 documents / 0 results. Something like CONTAINS will be useful, if it's possible.

Thanks for your time.


回答1:


Add a star "*" in front and at the end of every search string like "*Smit*".

Your code would look like this then

tmpArray[cTerms++]= "(Field txt_titlu = \"*" + sessionScope.searchTitle + "*\")";


来源:https://stackoverflow.com/questions/23486456/xpages-partial-full-search

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!