0
votes

I created an XPage and added a view control to it, based on a Notes view in which some of the columns are based on formulas rather than fields (for example, @If(nomprov="";cifprov;nomprov)). As a result, the column name on the XPage is a number preceded by a dollar sign, such as $14. View columns that are field based do not show such behavior (the column name on the XPage is the name of the field).

This did not harm on any way, but now I am trying to implement full-text search on the XPage view, and the search on $* columns is not working. This is the definition of one of these columns on the page source:

<xp:viewColumn id="viewColumn3" styleClass="columna"
        columnName="$14">
        <xp:viewColumnHeader value="Proveedor"
            id="viewColumnHeader3" styleClass="cabecera" sortable="true">
        </xp:viewColumnHeader>
    </xp:viewColumn>

And this is the code I have on the property data\data\search of the view:

var qstring;

if (sessionScope.searchNumfac != null & sessionScope.searchNumfac != "") {
qstring = "(Field numfac = *" + sessionScope.searchNumfac + "*)"
+ " OR (Field nomsociedad = *" + sessionScope.searchNumfac + "*)"
+ " OR (Field $14 = *" + sessionScope.searchNumfac + "*)";  

}

    sessionScope.queryString = qstring;
return qstring

Where searchNumFac corresponds to the value on the search box. The search on columns "numfac" and "nomsociedad" works great, but it fails on the $14 column. I also tried changing the $14 on the code by the column title on the Notes view (proveedor) and the column title on the XPage view (Proveedor), but it is still not working.

Do you know of any way to work around this?

Thanks a lot,

Carlos

1
The column name is actually defined in the view column properties in the advanced tab, you can use any name. The $ is used to avoid collision with field names. But columns are not full text indexed. Document items a.k.a. fields arestwissel

1 Answers

1
votes

View columns are not part of full text index. You have to use field names for your full text search.

In your example it means that instead of $14 you have to use the fieldnames from your column formula @If(nomprov="";cifprov;nomprov)):

...
+ " OR (Field nomprov = *" + sessionScope.searchNumfac + "*)"
+ " OR (Field cifprov = *" + sessionScope.searchNumfac + "*)";