Filters the table according to given search string.<p>

@param search string to be looked for.
329254
@SuppressWarnings("unchecked")
    public void filterTable(String search) {

        m_container.removeAllContainerFilters();
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(search)) {
            m_container.addContainerFilter(
                new Or(
                    new SimpleStringFilter(TableColumn.Channel, search, true, false),
                    new SimpleStringFilter(TableColumn.ParentChannel, search, true, false),
                    new SimpleStringFilter(TableColumn.File, search, true, false)));
        }
        if ((getValue() != null) & !((Set<Logger>)getValue()).isEmpty()) {
            setCurrentPageFirstItemId(((Set<Logger>)getValue()).iterator().next());
        }
    }
1108642
public CmsSolrResultList search(CmsObject cms, SolrQuery query) throws CmsSearchException {

        return search(cms, CmsEncoder.decode(query.toString()));
    }
889936
public CmsRelationFilter filterResource(CmsResource resource) {

        CmsRelationFilter filter = filterStructureId(resource.getStructureId());
        filter = filterPath(resource.getRootPath());
        return filter;
    }
645891
def filter_search(self, search):
        
        builder = QueryBuilder(
            self.filtering_fields,
            self.filtering_map,
            self
        )
        search, unmatched = builder.build(search, self.get_query_params())

        # Ensure that no unsupported arguments were used.
        for argument in self.get_always_allowed_arguments():
            unmatched.pop(argument, None)

        if unmatched:
            msg = 'Unsupported parameter(s): {}. Please use a combination of: {}.'.format(
                ', '.join(unmatched),
                ', '.join(self.filtering_fields),
            )
            raise ParseError(msg)

        return search
29139
public void clearTextSearch() {

        m_searchObject.clearFullTextSearch();
        m_handler.onClearFullTextSearch();
        updateResultsTab(false);
        ValueChangeEvent.fire(this, m_searchObject);
    }
238733
@UiHandler("m_searchInput")
    protected void onSearchInputChange(ValueChangeEvent<String> event) {

        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(event.getValue()) && (event.getValue().length() >= 3)) {
            m_tabHandler.setSearchQuery(event.getValue());
        } else {
            m_tabHandler.setSearchQuery(null);
        }
    }
829315
def filter(self, search):
        
        if not self._filters:
            return search

        post_filter = MatchAll()
        for f in itervalues(self._filters):
            post_filter &= f
        return search.post_filter(post_filter)
583170
protected void filterTable(String search) {

        m_container.removeAllContainerFilters();
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(search)) {
            m_container.addContainerFilter(
                new Or(
                    new SimpleStringFilter(PROP_CAPTION, search, true, false),
                    new SimpleStringFilter(PROP_DESCRIPTION, search, true, false)));
        }
    }
710072
def filter(self, table, idps, filter_string):
        """"""
        q = filter_string.lower()
        return [idp for idp in idps
                if q in idp.ud.lower()]
1004883
private CmsGallerySearchBean search(CmsGallerySearchBean searchObj) throws CmsException {

        CmsGallerySearchBean searchObjBean = new CmsGallerySearchBean(searchObj);
        if (searchObj == null) {
            return searchObjBean;
        }
        // store folder filter
        storeFolderFilter(searchObj.getFolders());

        // search
        CmsGallerySearchParameters params = prepareSearchParams(searchObj);
        org.opencms.search.galleries.CmsGallerySearch searchBean = new org.opencms.search.galleries.CmsGallerySearch();
        CmsObject searchCms = getSearchCms(searchObj);
        searchBean.init(searchCms);

        CmsGallerySearchResultList searchResults = OpenCms.getSearchManager().getIndexSolr(
            "Solr Offline").gallerySearch(searchCms, params);
        searchResults.calculatePages(params.getResultPage(), params.getMatchesPerPage());

        // set only the result dependent search params for this search
        // the user dependent params(galleries, types etc.) remain unchanged
        searchObjBean.setSortOrder(params.getSortOrder().name());
        searchObjBean.setScope(params.getScope());
        searchObjBean.setResultCount(searchResults.getHitCount());
        searchObjBean.setPage(params.getResultPage());
        searchObjBean.setLastPage(params.getResultPage());
        searchObjBean.setResults(buildSearchResultList(searchResults, null));
        if (searchObj.getGalleryMode().equals(GalleryMode.ade)) {
            if (searchObjBean.getResultCount() > 0) {
                CmsADESessionCache cache = CmsADESessionCache.getCache(getRequest(), getCmsObject());
                cache.setLastPageEditorGallerySearch(searchObj);
            }
        }
        updateNoUploadReason(searchCms, searchObjBean);
        return searchObjBean;
    }
64015
def filter(self, table, groups, filter_string):
        """"""
        query = filter_string.lower()
        return [group for group in groups
                if query in group.name.lower()]
1114825
public void filterTable(String text) {

        m_container.removeAllContainerFilters();
        if (!CmsStringUtil.isEmptyOrWhitespaceOnly(text)) {
            m_container.addContainerFilter(
                new Or(
                    new SimpleStringFilter(TableProperty.Name, text, true, false),
                    new SimpleStringFilter(TableProperty.ShortName, text, true, false),
                    new SimpleStringFilter(TableProperty.Module, text, true, false)));
        }

    }
634268
public String displaySearchResult(CmsSearch search) {

        StringBuffer result = new StringBuffer(800);
        Locale locale = m_jsp.getRequestContext().getLocale();
        CmsMessages messages = org.opencms.search.Messages.get().getBundle(locale);

        result.append("<h3>\n");
        result.append(messages.key(org.opencms.search.Messages.GUI_HELP_SEARCH_RESULT_TITLE_0));
        result.append("\n</h1>\n");
        List<CmsSearchResult> searchResult;
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(search.getQuery())) {
            search.setQuery("");
            searchResult = Collections.emptyList();
        } else {
            search.setMatchesPerPage(5);
            searchResult = search.getSearchResult();
        }

        HttpServletRequest request = m_jsp.getRequest();
        // get the action to perform from the request
        String action = request.getParameter("action");

        if ((action != null) && (searchResult == null)) {
            result.append("<p class=\"formerror\">\n");
            if (search.getLastException() != null) {

                result.append(messages.key(org.opencms.search.Messages.GUI_HELP_SEARCH_UNAVAILABLE_0));
                result.append("\n<!-- ").append(search.getLastException().toString());
                result.append(" //-->\n");
            } else {
                result.append(messages.key(org.opencms.search.Messages.GUI_HELP_SEARCH_NOMATCH_1, search.getQuery()));
                result.append("\n");
            }
            result.append("</p>\n");
        } else if ((action != null) && (searchResult.size() <= 0)) {
            result.append("<p class=\"formerror\">\n");
            result.append(messages.key(org.opencms.search.Messages.GUI_HELP_SEARCH_NOMATCH_1, search.getQuery()));
            result.append("\n");
            result.append("</p>\n");
        } else if ((action != null) && (searchResult.size() > 0)) {
            result.append("<p>\n");
            result.append(messages.key(org.opencms.search.Messages.GUI_HELP_SEARCH_RESULT_START_0));
            result.append("\n");
            result.append("</p>\n<p>\n");

            Iterator<CmsSearchResult> iterator = searchResult.iterator();

            try {
                if (m_exportLinks) {
                    m_jsp.getRequestContext().setCurrentProject(m_onlineProject);
                }

                String name;
                String path;
                while (iterator.hasNext()) {
                    CmsSearchResult entry = iterator.next();
                    result.append("\n<div class=\"searchResult\">");
                    result.append("<a class=\"navhelp\" href=\"#\" onclick=\"javascript:window.open('");
                    // CmsJspActionElement.link() is not programmed for using from root site
                    // because it assumes the "default CmsSite" when no configured site matches the
                    // root site "/":
                    if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_jsp.getRequestContext().getSiteRoot())) {
                        // link will always cut off "/sites/default" if we are in the
                        // root site, this call is only used to get the scheme, host, context name and servlet name...
                        path = m_jsp.link(OpenCms.getSiteManager().getDefaultSite().getSiteRoot() + "/")
                            + entry.getPath().substring(1);
                    } else {
                        path = m_jsp.link(entry.getPath());
                    }
                    result.append(path);
                    result.append(
                        "', '_blank', 'width='+screen.availWidth+', height='+ screen.availHeight+', scrollbars=yes, menubar=yes, toolbar=yes')\"");
                    result.append("\">\n");
                    name = entry.getField(CmsSearchField.FIELD_TITLE);
                    if (name == null) {
                        name = entry.getPath();
                    }
                    result.append(name);
                    result.append("</a>");
                    result.append("&nbsp;(").append(entry.getScore()).append("&nbsp;%)\n");

                    result.append("<span class=\"searchExcerpt\">\n");
                    String excerptString = entry.getExcerpt();
                    if (CmsStringUtil.isEmptyOrWhitespaceOnly(excerptString)) {
                        result.append(messages.key(org.opencms.search.Messages.GUI_HELP_SEARCH_EXCERPT_UNAVAILABLE_0));
                    } else {
                        result.append(excerptString).append('\n');
                    }
                    result.append("</span>\n");
                    result.append("</div>\n");
                }
            } finally {
                m_jsp.getRequestContext().setCurrentProject(m_offlineProject);
            }

            result.append("</p>\n");

            // search page links below results
            if ((search.getPreviousUrl() != null) || (search.getNextUrl() != null)) {
                result.append("<p>");
                if (search.getPreviousUrl() != null) {

                    result.append("<a class=\"searchlink\" href=\"");
                    result.append(
                        getSearchPageLink(
                            m_jsp.link(new StringBuffer(search.getPreviousUrl()).append('&').append(
                                CmsLocaleManager.PARAMETER_LOCALE).append("=").append(
                                    m_jsp.getRequestContext().getLocale()).toString()),
                            search));
                    result.append("\">");
                    result.append(messages.key(org.opencms.search.Messages.GUI_HELP_BUTTON_BACK_0));
                    result.append(" &lt;&lt;</a>&nbsp;&nbsp;\n");
                }
                Map<Integer, String> pageLinks = search.getPageLinks();
                Iterator<Integer> i = pageLinks.keySet().iterator();
                while (i.hasNext()) {
                    int pageNumber = (i.next()).intValue();

                    result.append(" ");
                    if (pageNumber != search.getSearchPage()) {
                        result.append("<a class=\"searchlink\" href=\"").append(
                            getSearchPageLink(
                                m_jsp.link(new StringBuffer(pageLinks.get(new Integer(pageNumber))).append('&').append(
                                    CmsLocaleManager.PARAMETER_LOCALE).append("=").append(
                                        m_jsp.getRequestContext().getLocale()).toString()),
                                search));
                        result.append("\" target=\"_self\">").append(pageNumber).append("</a>\n");
                    } else {
                        result.append(pageNumber);
                    }
                }
                if (search.getNextUrl() != null) {
                    result.append("&nbsp;&nbsp;&nbsp;<a class=\"searchlink\" href=\"");
                    result.append(
                        getSearchPageLink(
                            new StringBuffer(m_jsp.link(search.getNextUrl())).append('&').append(
                                CmsLocaleManager.PARAMETER_LOCALE).append("=").append(
                                    m_jsp.getRequestContext().getLocale()).toString(),
                            search));
                    result.append("\">&gt;&gt;");
                    result.append(messages.key(org.opencms.search.Messages.GUI_HELP_BUTTON_NEXT_0));
                    result.append("</a>\n");
                }
                result.append("</p>\n");
            }

        }

        // include the post forms for the page links:
        Iterator<HTMLForm> values = m_formCache.values().iterator();
        while (values.hasNext()) {
            result.append(values.next());
        }
        return result.toString();

    }
305006
public void setSearchString(String queryString)
    {
        this.searchString = queryString;
        if (this.textFilterField != null)
        {
            this.textFilterField.setText(this.searchString);
        }
    }
1029413
def filter(self, table, mappings, filter_string):
        """"""
        q = filter_string.lower()
        return [mapping for mapping in mappings
                if q in mapping.ud.lower()]
1313204
void updateSearchResults(boolean selectFirstMatch)
    {
        clearHighlights();
        searchPanel.setMessage("");
        
        String query = searchPanel.getQuery();

        if (query.isEmpty())
        {
            handleMatch(null);
            return;
        }
        
        String text = getDocumentText();
        boolean ignoreCase = !searchPanel.isCaseSensitive();
        List<Point> appearances = 
            JTextComponents.find(text, query, ignoreCase);
        addHighlights(appearances, highlightColor);

        int caretPosition = textComponent.getCaretPosition();
        Point match = JTextComponents.findNext(
            text, query, caretPosition, ignoreCase);
        if (match == null)
        {
            match = JTextComponents.findNext(
                text, query, 0, ignoreCase);
        }
        if (selectFirstMatch)
        {
            handleMatch(match);
        }
        else
        {
            handleMatch(null);
        }

        if (appearances.isEmpty())
        {
            searchPanel.setMessage("Not found");
        }
        else
        {
            searchPanel.setMessage(
                "Found " + appearances.size() + " times");
        }
    }
643334
private void searchAndAddToResults(EntityMetadata m, String persistenceUnit, ConsistencyLevel consistencyLevel,
            String columnFamilyName, List<SearchResult> searchResults, IndexExpression expression, boolean isRowKeyQuery)
    {
        SearchResult searchResult = new SearchResult();

        byte[] superColumnName = expression.getValue();
        String superColumnNameStr = null;
        String rowKey = null;
        try
        {
            rowKey = ByteBufferUtil.string(ByteBuffer.wrap(expression.getColumn_name()),
                    Charset.forName(Constants.CHARSET_UTF8));
            superColumnNameStr = new String(expression.getValue(), Charset.forName(Constants.CHARSET_UTF8));
        }
        catch (CharacterCodingException e)
        {
            log.error("Error while retrieving records {}, Caused by:", e);
            throw new PersistenceException(e);
        }
        Object pk = PropertyAccessorHelper.getObject(m.getIdAttribute().getJavaType(), superColumnName);
        IndexOperator condition = expression.getOp();

        if (log.isInfoEnabled())
        {
            log.info("RowKey: {} ; Super column Name: {} on condition.", rowKey, superColumnNameStr, condition);
        }

        // TODO: Second check unnecessary but unavoidable as filter clause
        // property is incorrectly passed as column name

        // Search based on Primary key
        if (isRowKeyQuery
                && (rowKey.equals(m.getIdAttribute().getName()) || rowKey.equals(((DefaultSingularAttribute) m
                        .getIdAttribute()).getJPAColumnName())))
        {
            if (searchResults.isEmpty())
            {
                searchResult.setPrimaryKey(pk);
                searchResults.add(searchResult);
            }
            else
            {
                SearchResult existing = searchResults.get(0);
                if (existing.getPrimaryKey() != null && existing.getPrimaryKey().equals(superColumnNameStr))
                {
                    searchResults.add(searchResult);
                }
                else
                {
                    searchResults.remove(0);
                }
            }
        }
        else
        {
            // Search results in the form of thrift super columns
            List<SuperColumn> thriftSuperColumns = new ArrayList<SuperColumn>();

            switch (condition)
            {
            // EQUAL Operator
            case EQ:
                SuperColumn thriftSuperColumn = getSuperColumnForRow(consistencyLevel, columnFamilyName, rowKey,
                        superColumnName, persistenceUnit);

                if (thriftSuperColumn != null)
                    thriftSuperColumns.add(thriftSuperColumn);
                break;

            // LIKE operation not available
            // Greater than operator
            case GT:
                searchSuperColumnsInRange(columnFamilyName, consistencyLevel, persistenceUnit, rowKey, superColumnName,
                        thriftSuperColumns, superColumnName, new byte[0]);
                break;
            // Less than Operator
            case LT:
                searchSuperColumnsInRange(columnFamilyName, consistencyLevel, persistenceUnit, rowKey, superColumnName,
                        thriftSuperColumns, new byte[0], superColumnName);
                break;
            // Greater than-equals to operator
            case GTE:
                searchSuperColumnsInRange(columnFamilyName, consistencyLevel, persistenceUnit, rowKey, superColumnName,
                        thriftSuperColumns, superColumnName, new byte[0]);
                break;
            // Less than equal to operator
            case LTE:
                searchSuperColumnsInRange(columnFamilyName, consistencyLevel, persistenceUnit, rowKey, superColumnName,
                        thriftSuperColumns, new byte[0], superColumnName);
                break;

            default:
                throw new QueryHandlerException(condition
                        + " comparison operator not supported currently for Cassandra Inverted Index.");
            }

            // Construct search results out of these thrift columns
            for (SuperColumn thriftSuperColumn : thriftSuperColumns)
            {

                for (Column column : thriftSuperColumn.getColumns())
                {
                    byte[] columnName = column.getName();
                    searchResult.setPrimaryKey(PropertyAccessorHelper.getObject(m.getIdAttribute().getJavaType(),
                            columnName));
                    byte[] columnValue = column.getValue();
                    String ecValue = UTF8Type.instance.compose(ByteBuffer.wrap(columnValue));

                    if (ecValue != null && !"".equals(ecValue.trim()))
                    {
                        searchResult.setEmbeddedColumnName(rowKey.substring(0,
                                rowKey.indexOf(Constants.INDEX_TABLE_ROW_KEY_DELIMITER)));
                        searchResult.addEmbeddedColumnValue(ecValue);
                    }
                }

                if (searchResults.isEmpty())
                {
                    searchResults.add(searchResult);
                }
                else
                {
                    SearchResult existing = searchResults.get(0);
                    if (existing.getPrimaryKey() != null
                            && existing.getPrimaryKey().equals(searchResult.getPrimaryKey()))
                    {
                        searchResults.add(searchResult);
                    }
                    else
                    {
                        searchResults.remove(0);
                    }
                }

            }
        }
    }