资源简介
jar包中包含了sphinx-javaapi中的查询,更新索引的方法。
其中SphinxClient类中包含了大部分查询,更新方法。
UpdateAttributes为主要的更新方法,参数使用的是键值对应的模式,如有不明白的,请仔细查看方法体中的demo。
代码片段和文件信息
/*
* $Id: SphinxClient.java 1462 2008-09-23 12:34:36Z shodan $
*
* Java version of Sphinx searchd client (Java API)
*
* Copyright (c) 2007-2008 Andrew Aksyonoff
* Copyright (c) 2007 Vladimir Fedorkov
* 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/
*/
package org.sphx.api;
import java.io.*;
import java.net.*;
import java.util.*;
/** Sphinx client class */
public class SphinxClient
{
/* matching modes */
public final static int SPH_MATCH_ALL = 0;
public final static int SPH_MATCH_ANY = 1;
public final static int SPH_MATCH_PHRASE = 2;
public final static int SPH_MATCH_BOOLEAN = 3;
public final static int SPH_MATCH_EXTENDED = 4;
public final static int SPH_MATCH_FULLSCAN = 5;
public final static int SPH_MATCH_EXTENDED2 = 6;
/* ranking modes (extended2 only) */
public final static int SPH_RANK_PROXIMITY_BM25 = 0;
public final static int SPH_RANK_BM25 = 1;
public final static int SPH_RANK_NONE = 2;
public final static int SPH_RANK_WORDCOUNT = 3;
/* sorting modes */
public final static int SPH_SORT_RELEVANCE = 0;
public final static int SPH_SORT_ATTR_DESC = 1;
public final static int SPH_SORT_ATTR_ASC = 2;
public final static int SPH_SORT_TIME_SEGMENTS = 3;
public final static int SPH_SORT_EXTENDED = 4;
public final static int SPH_SORT_EXPR = 5;
/* grouping functions */
public final static int SPH_GROUPBY_DAY = 0;
public final static int SPH_GROUPBY_WEEK = 1;
public final static int SPH_GROUPBY_MONTH = 2;
public final static int SPH_GROUPBY_YEAR = 3;
public final static int SPH_GROUPBY_ATTR = 4;
public final static int SPH_GROUPBY_ATTRPAIR = 5;
/* searchd reply status codes */
public final static int SEARCHD_OK = 0;
public final static int SEARCHD_ERROR = 1;
public final static int SEARCHD_RETRY = 2;
public final static int SEARCHD_WARNING = 3;
/* attribute types */
public final static int SPH_ATTR_INTEGER = 1;
public final static int SPH_ATTR_TIMESTAMP = 2;
public final static int SPH_ATTR_ORDINAL = 3;
public final static int SPH_ATTR_BOOL = 4;
public final static int SPH_ATTR_FLOAT = 5;
public final static int SPH_ATTR_BIGINT = 6;
public final static int SPH_ATTR_MULTI = 0x40000000;
/* searchd commands */
private final static int SEARCHD_COMMAND_SEARCH = 0;
private final static int SEARCHD_COMMAND_EXCERPT = 1;
private final static int SEARCHD_COMMAND_UPDATE = 2;
private final static int SEARCHD_COMMAND_KEYWORDS = 3;
/* searchd command versions */
private final static int VER_MAJOR_PROTO = 0x1;
private final static int VER_COMMAND_SEARCH = 0x116;
private final static int VER_COMMAND_EXCERPT = 0x100;
private final static int VER_COMMAND_UPDATE = 0x101;
private final static int VER_COMMAND_KEYWOR
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
....... 545 2009-03-14 00:00 java\Makefile
....... 52 2009-03-14 00:00 java\manifest.mf
....... 84 2009-03-14 00:00 java\mk.cmd
....... 22 2009-03-14 00:00 java\mkdoc.cmd
....... 725 2009-03-14 00:00 java\readme
文件 37205 2010-03-11 09:30 java\SphinxClient.java
文件 37221 2010-03-11 09:23 java\SphinxClient.java.bak
....... 482 2009-03-14 00:00 java\SphinxException.java
....... 618 2009-03-14 00:00 java\SphinxMatch.java
....... 1591 2009-03-14 00:00 java\SphinxResult.java
....... 652 2009-03-14 00:00 java\SphinxWordInfo.java
....... 6481 2009-03-14 00:00 java\test.java
目录 0 2010-03-11 09:23 java
----------- --------- ---------- ----- ----
85678 13
- 上一篇:xUtils 3.5 jar包最新版本
- 下一篇:经典贪吃蛇java版
相关资源
- 经典贪吃蛇java版
- Http器 FTP器java
- JSP七个小项目代码和笔记汇总(java
- JAVA获取客户端MAC,web获取客户端MAC,
- socket结合spring的
- java 使用jdbc封装连接数据库
- 大学学籍管理系统 javaweb 课程设计
- plugin-unstructured-storage-util-0.0.1-SNAPSHO
- Java Swing 数据库 上传显示图片
- java异常机制处理
- javaweb购物车_java 小项目
- 一个从JAVA直接生成UML图的软件
- java jxl添加水印(修改编译版)本版本
- JAVA聊天室项目
- java窗口输入并保存学生信息
- java 三视图与正轴测投影 计算机图形
- 带设计文档的 JAVA的 500行左右的 简单
- 传智播客毕向东Java基础全套视频教程
- 以文件储存数据的java自动阅卷系统
- jsp 关于留言和空间发表日志
- java学士后第一单元项目 北大青鸟音乐
- GUI版Java五子棋源码,可人机对战,经
- 多维k-means聚类算法java实现,导入直接
- java小游戏推箱子(含界面)
- java实现邮件发送三种发送方式都有
- Java拼图游戏源程序和论文开题报告等
- java Swing实现计算器源码
- java-web学习demo--最简单的servlet jsp跳转
- GN算法的java实现
- 会员管理系统 用java图形界面做的
评论
共有 条评论