arya-blue
luna-amber
luna-blue
luna-green
luna-pink
nova-dark
nova-light
saga-blue
vela-blue
MarkText - Accuracy Levels
Demonstrates the accuracy property. 'partially' matches if the search term is contained in the text, 'exactly' matches only if the text equals the search term, 'complementarily' matches if the search term contains the text.
Search term:
Partially (accuracy='partially')

ips sum ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Exactly (accuracy='exactly')

ips sum ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Complementarily (accuracy='complementarily')

ips sum ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Source

                <h:panelGrid columns="3">
        <h:outputText value="Search term:"/>
        <p:inputText id="searchInput" value="#{markTextController.searchTermAccuracy}" placeholder="Enter search term">
             <p:ajax event="keyup" delay="500" update="partiallyPanel exactlyPanel complementarilyPanel markTextPartially markTextExactly markTextComplementarily"/>
        </p:inputText>
        <p:commandButton value="Highlight" update="partiallyPanel exactlyPanel complementarilyPanel markTextPartially markTextExactly markTextComplementarily" icon="pi pi-search"/>
    </h:panelGrid>

    <h:panelGrid columns="3" style="width: 100%">
        <p:panel id="partiallyPanel" header="Partially (accuracy='partially')" style="margin-right: 10px">
            <h:panelGroup id="partiallyContent" layout="block">
                <p>ips sum ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
            </h:panelGroup>
        </p:panel>

        <p:panel id="exactlyPanel" header="Exactly (accuracy='exactly')" style="margin-right: 10px">
            <h:panelGroup id="exactlyContent" layout="block">
                <p>ips sum ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
            </h:panelGroup>
        </p:panel>

        <p:panel id="complementarilyPanel" header="Complementarily (accuracy='complementarily')">
            <h:panelGroup id="complementarilyContent" layout="block">
                <p>ips sum ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
            </h:panelGroup>
        </p:panel>
    </h:panelGrid>

    <pe:markText id="markTextPartially" for="partiallyContent" value="#{markTextController.searchTermAccuracy}" styleClass="marktext-highlight" accuracy="partially"/>
    <pe:markText id="markTextExactly" for="exactlyContent" value="#{markTextController.searchTermAccuracy}" styleClass="marktext-highlight" accuracy="exactly"/>
    <pe:markText id="markTextComplementarily" for="complementarilyContent" value="#{markTextController.searchTermAccuracy}" styleClass="marktext-highlight" accuracy="complementarily"/>
            
Components and more
Documentation pe:markText
Attributes (move mouse over the names to see data types)
Name Description
accuracySearch accuracy level: 'partially', 'complementarily', or 'exactly'.Default is partially.
acrossElementsSearch across element boundaries.Default is false.
bindingAn EL expression referring to a server side UIComponent instance in a backing bean.Default is generated.
caseSensitiveWhether the search should be case sensitive.Default is false.
diacriticsWhether accented and unaccented letters are treated as the same during matching.Default is true.
excludeArray of exclusion selectors. Matches inside these elements will be ignored.
forSearch expression to resolve the target component to search within.
idUnique identifier of the component in a namingContainer.Default is generated.
iframesWhether matching should include same-origin iframe documents.Default is false.
iframesTimeoutMaximum wait time in milliseconds for iframe loading.Default is 5000.
renderedBoolean value to specify the rendering of the component, when set to false component will not be rendered.Default is true.
separateWordSearchWhether to match each word separately.Default is true.
styleInline style of the component.
styleClassStyle class of the component.
synonymsMap of synonyms for term matching.
valueSearch terms to highlight. Can be a string or array of strings.
widgetVarName of the client-side widget.
wildcardsWildcard matching mode: 'disabled'|'enabled'|'withSpaces'.Default is disabled.
PrimeFaces Extensions Showcase - © 2011-2025,PrimeFaces: 16.0.0-SNAPSHOT,PrimeFaces Extensions: 16.0.0-SNAPSHOT,JSF: Apache MyFaces Core 4.0 - Impl 4.0.3,Server: Apache Tomcat (TomEE)/10.1.52 (10.1.4),Build time: 2026-04-14 11:39