• 大小: 12.22MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-08
  • 语言: 其他
  • 标签: coreseek-4.1  windows  

资源简介

Coreseek的windows版本,因为官网打不开,因此上传此。 搭配Sphinx进行中文分词搜索

资源截图

代码片段和文件信息

#
# $Id$
#
# Python version of Sphinx searchd client (Python API)
#
# Copyright (c) 2006 Mike Osadnik
# Copyright (c) 2006-2011 Andrew Aksyonoff
# Copyright (c) 2008-2011 Sphinx Technologies Inc
# All rights reserved
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License. You should have
# received a copy of the GPL license along with this program; if you
# did not you can find it at http://www.gnu.org/
#

import sys
import select
import socket
import re
from struct import *


# known searchd commands
SEARCHD_COMMAND_SEARCH = 0
SEARCHD_COMMAND_EXCERPT = 1
SEARCHD_COMMAND_UPDATE = 2
SEARCHD_COMMAND_KEYWORDS = 3
SEARCHD_COMMAND_PERSIST = 4
SEARCHD_COMMAND_STATUS = 5
SEARCHD_COMMAND_FLUSHATTRS = 7

# current client-side command implementation versions
VER_COMMAND_SEARCH = 0x119
VER_COMMAND_EXCERPT = 0x103
VER_COMMAND_UPDATE = 0x102
VER_COMMAND_KEYWORDS = 0x100
VER_COMMAND_STATUS = 0x100
VER_COMMAND_FLUSHATTRS = 0x100

# known searchd status codes
SEARCHD_OK = 0
SEARCHD_ERROR = 1
SEARCHD_RETRY = 2
SEARCHD_WARNING = 3

# known match modes
SPH_MATCH_ALL = 0
SPH_MATCH_ANY = 1
SPH_MATCH_PHRASE = 2
SPH_MATCH_BOOLEAN = 3
SPH_MATCH_EXTENDED = 4
SPH_MATCH_FULLSCAN = 5
SPH_MATCH_EXTENDED2 = 6

# known ranking modes (extended2 mode only)
SPH_RANK_PROXIMITY_BM25 = 0 # default mode phrase proximity major factor and BM25 minor one
SPH_RANK_BM25 = 1 # statistical mode BM25 ranking only (faster but worse quality)
SPH_RANK_NONE = 2 # no ranking all matches get a weight of 1
SPH_RANK_WORDCOUNT = 3 # simple word-count weighting rank is a weighted sum of per-field keyword occurence counts
SPH_RANK_PROXIMITY = 4
SPH_RANK_MATCHANY = 5
SPH_RANK_FIELDMASK = 6
SPH_RANK_SPH04 = 7
SPH_RANK_EXPR = 8
SPH_RANK_TOTAL = 9

# known sort modes
SPH_SORT_RELEVANCE = 0
SPH_SORT_ATTR_DESC = 1
SPH_SORT_ATTR_ASC = 2
SPH_SORT_TIME_SEGMENTS = 3
SPH_SORT_EXTENDED = 4
SPH_SORT_EXPR = 5

# known filter types
SPH_FILTER_VALUES = 0
SPH_FILTER_RANGE = 1
SPH_FILTER_FLOATRANGE = 2

# known attribute types
SPH_ATTR_NONE = 0
SPH_ATTR_INTEGER = 1
SPH_ATTR_TIMESTAMP = 2
SPH_ATTR_ORDINAL = 3
SPH_ATTR_BOOL = 4
SPH_ATTR_FLOAT = 5
SPH_ATTR_BIGINT = 6
SPH_ATTR_STRING = 7
SPH_ATTR_MULTI = 0X40000001L
SPH_ATTR_MULTI64 = 0X40000002L

SPH_ATTR_TYPES = (SPH_ATTR_NONE
  SPH_ATTR_INTEGER
  SPH_ATTR_TIMESTAMP
  SPH_ATTR_ORDINAL
  SPH_ATTR_BOOL
  SPH_ATTR_FLOAT
  SPH_ATTR_BIGINT
  SPH_ATTR_STRING
  SPH_ATTR_MULTI
  SPH_ATTR_MULTI64)

# known grouping functions
SPH_GROUPBY_DAY   = 0
SPH_GROUPBY_WEEK = 1
SPH_GROUPBY_MONTH = 2
SPH_GROUPBY_YEAR = 3
SPH_GROUPBY_ATTR = 4
SPH_GROUPBY_ATTRPAIR = 5


class SphinxClient:
def __init__ (self):
“““
Create a new client object and fill defaults.
“““
self._host = ‘localhost‘ # searchd host (default is “localhost“)
self._port = 9312 # searchd port (default is 9312)

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-05-29 09:58  coreseek-4.1-win32\
     文件        2681  2013-04-23 14:47  coreseek-4.1-win32\README.txt
     目录           0  2013-04-23 15:10  coreseek-4.1-win32\api\
     目录           0  2013-04-23 15:10  coreseek-4.1-win32\api\java\
     文件          52  2013-04-23 14:47  coreseek-4.1-win32\api\java\MANIFEST.MF
     文件         545  2013-04-23 14:47  coreseek-4.1-win32\api\java\Makefile
     文件         725  2013-04-23 14:47  coreseek-4.1-win32\api\java\README
     文件       44210  2013-04-23 14:47  coreseek-4.1-win32\api\java\SphinxClient.java
     文件         370  2013-04-23 14:47  coreseek-4.1-win32\api\java\SphinxException.java
     文件         514  2013-04-23 14:47  coreseek-4.1-win32\api\java\SphinxMatch.java
     文件        1485  2013-04-23 14:47  coreseek-4.1-win32\api\java\SphinxResult.java
     文件         542  2013-04-23 14:47  coreseek-4.1-win32\api\java\SphinxWordInfo.java
     文件          84  2013-04-23 14:47  coreseek-4.1-win32\api\java\mk.cmd
     文件          22  2013-04-23 14:47  coreseek-4.1-win32\api\java\mkdoc.cmd
     文件        6489  2013-04-23 14:47  coreseek-4.1-win32\api\java\test.java
     目录           0  2013-04-23 15:10  coreseek-4.1-win32\api\libsphinxclient\
     文件       25276  2013-04-23 14:47  coreseek-4.1-win32\api\libsphinxclient\COPYING
     文件         335  2013-04-23 14:47  coreseek-4.1-win32\api\libsphinxclient\Makefile.am
     文件       19806  2013-04-23 14:47  coreseek-4.1-win32\api\libsphinxclient\Makefile.in
     文件        1454  2013-04-23 14:47  coreseek-4.1-win32\api\libsphinxclient\README
     文件        1173  2013-04-23 14:47  coreseek-4.1-win32\api\libsphinxclient\build.mk
     文件         640  2013-04-23 14:47  coreseek-4.1-win32\api\libsphinxclient\buildconf.sh
     文件       42037  2013-04-23 14:47  coreseek-4.1-win32\api\libsphinxclient\config.guess
     文件       30221  2013-04-23 14:47  coreseek-4.1-win32\api\libsphinxclient\config.sub
     文件      652088  2013-04-23 14:47  coreseek-4.1-win32\api\libsphinxclient\configure
     文件        1648  2013-04-23 14:47  coreseek-4.1-win32\api\libsphinxclient\configure.in
     文件        9206  2013-04-23 14:47  coreseek-4.1-win32\api\libsphinxclient\install-sh
     文件        3571  2013-04-23 14:47  coreseek-4.1-win32\api\libsphinxclient\libsphinxclient.vcproj
     文件      183730  2013-04-23 14:47  coreseek-4.1-win32\api\libsphinxclient\ltmain.sh
     文件       10587  2013-04-23 14:47  coreseek-4.1-win32\api\libsphinxclient\missing
     文件        9474  2013-04-23 14:47  coreseek-4.1-win32\api\libsphinxclient\smoke_ref.txt
............此处省略236个文件信息

评论

共有 条评论