本文整理汇总了Python中searcher.Searcher.getHighlighting方法的典型用法代码示例。如果您正苦于以下问题:Python Searcher.getHighlighting方法的具体用法?Python Searcher.getHighlighting怎么用?Python Searcher.getHighlighting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类searcher.Searcher
的用法示例。
在下文中一共展示了Searcher.getHighlighting方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MainWindow
# 需要导入模块: from searcher import Searcher [as 别名]
# 或者: from searcher.Searcher import getHighlighting [as 别名]
class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
def __init__(self, parent = None):
super(MainWindow, self).__init__(parent)
self.setupUi(self)
self.searchResultsView = SearchResultsView(self.listView_result)
self.searchResultsView.viewDetailedContent.connect(self.showDetailedContent)
self.facetView = FacetView(self.treeView_facet)
self.facetView.facetOptionChanged.connect(self.search)
# searcher
self.searcher = Searcher()
self.searcher.searchDone.connect(self.searchDone)
self.createConnections()
def createConnections(self):
self.pushButton_search.clicked.connect(self.searchResultsView.clear)
self.pushButton_search.clicked.connect(self.facetView.clear)
self.pushButton_search.clicked.connect(self.search)
def search(self):
query = self.lineEdit_search.text()
options = self.facetView.getFacetSearchOptions()
self.searcher.search(query, options)
def showDetailedContent(self, fileLocation):
myviewer = viewer.viewerSimpleFactory(fileLocation, self)
myviewer.showDetailedContent()
@QtCore.Slot(int)
def searchDone(self, searchResultCount):
if searchResultCount > 0:
self.searchResultsView.handleSearchResults(self.searcher.getDocs(), self.searcher.getHighlighting())
self.facetView.handleSearchResults(self.searcher.getFacets())
self.label_searchResult.setText('About {0} search results for [{1}]'.format(searchResultCount, self.searcher.getQuery()))