Skip to content

Commit

Permalink
Merge branch 'master' into removign_release_version
Browse files Browse the repository at this point in the history
  • Loading branch information
mnunberg committed May 29, 2019
2 parents ca219b8 + 343ad9b commit 2166c39
Show file tree
Hide file tree
Showing 91 changed files with 1,835 additions and 815 deletions.
16 changes: 8 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ INCLUDE(cmake/redisearch_cflags.cmake)
CMAKE_POLICY(SET CMP0026 OLD)

OPTION(RS_RUN_TESTS "Build & Run RediSearch's tests" OFF)
OPTION(USE_ASAN "Use AddressSanitizer (clang)" OFF)
OPTION(USE_MSAN "Use MemorySanitizer (clang)" OFF)

ADD_DEFINITIONS(-UNDEBUG)

Expand Down Expand Up @@ -80,24 +82,20 @@ SET(FINAL_OBJECTS
$<TARGET_OBJECTS:snowball>
$<TARGET_OBJECTS:metaphone>)

ADD_LIBRARY(redisearchS STATIC ${FINAL_OBJECTS})
ADD_LIBRARY(redisearch SHARED ${FINAL_OBJECTS} src/module-init/module-init.c)
ADD_LIBRARY(api_stubs STATIC src/c_utils/api_stubs.c)
ADD_EXECUTABLE(sizes src/c_utils/sizes.cpp)
TARGET_LINK_LIBRARIES(sizes redisearch dl api_stubs)

TARGET_LINK_LIBRARIES(redisearch dl m)
SET_TARGET_PROPERTIES(redisearch PROPERTIES PREFIX "")
SET_TARGET_PROPERTIES(redisearch PROPERTIES SUFFIX ".so")
TARGET_LINK_LIBRARIES(redisearchS -lm -lc -ldl)

IF (APPLE)
SET_TARGET_PROPERTIES(redisearch
PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
ENDIF()

IF (RS_RUN_TESTS)
SET(BUILD_GTEST ON CACHE BOOL "" FORCE)
SET(BUILD_GMOCK OFF CACHE BOOL "" FORCE)
SET(BUILD_SHARED_LIBS ON CACHE BOOL "enable shared libs" FORCE)
SET(BUILD_GTEST ON CACHE BOOL "enable gtest" FORCE)
SET(BUILD_GMOCK OFF CACHE BOOL "disable gmock" FORCE)
ADD_SUBDIRECTORY(src/dep/gtest)
ADD_SUBDIRECTORY(src/cpptests)
ADD_SUBDIRECTORY(src/tests)
Expand All @@ -114,3 +112,5 @@ GET_TARGET_PROPERTY(RMTEST_EXT_PATH example_extension LOCATION)

CONFIGURE_FILE(cmake/rmtest.config.in
${PROJECT_BINARY_DIR}/rmtest.config.default)

ADD_SUBDIRECTORY(src/c_utils)
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[![GitHub issues](https://img.shields.io/github/release/RedisLabsModules/RediSearch.svg)](https://github.com/RedisLabsModules/RediSearch/releases/latest)
[![CircleCI](https://circleci.com/gh/RedisLabsModules/RediSearch/tree/master.svg?style=svg)](https://circleci.com/gh/RedisLabsModules/RediSearch/tree/master)
[![GitHub issues](https://img.shields.io/github/release/RediSearch/RediSearch.svg)](https://github.com/RediSearch/RediSearch/releases/latest)
[![CircleCI](https://circleci.com/gh/RediSearch/RediSearch/tree/master.svg?style=svg)](https://circleci.com/gh/RediSearch/RediSearch/tree/master)
[![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/redislabs/redisearch.svg)](https://hub.docker.com/r/redislabs/redisearch/builds/)

# RediSearch

### Full-Text search over Redis by RedisLabs
![logo.png](docs/logo.png)
<img src="docs/img/logo.svg" alt="logo" width="300"/>

### See Full Documentation at [https://oss.redislabs.com/redisearch/](https://oss.redislabs.com/redisearch/)

Expand Down
7 changes: 7 additions & 0 deletions cmake/redisearch_cflags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,12 @@ IF (HAVE_W_INCOMPATIBLE_POINTER_TYPES)
ENDIF()
ENDIF()

IF (USE_ASAN)
SET(RS_COMMON_FLAGS "${RS_COMMON_FLAGS} -fno-omit-frame-pointer -fsanitize=address")
ELSEIF(USE_MSAN)
SET(RS_COMMON_FLAGS "${RS_COMMON_FLAGS} -fno-omit-frame-pointer -fsanitize=memory -fsanitize-memory-track-origins=2")
SET(CMAKE_LINKER "${CMAKE_C_COMPILER}")
ENDIF()

SET(RS_C_FLAGS "${RS_COMMON_FLAGS} -std=gnu99")
SET(RS_CXX_FLAGS "${RS_COMMON_FLAGS} -fno-rtti -fno-exceptions -std=c++11")
105 changes: 101 additions & 4 deletions docs/Commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ OK or an error
```
FT.ADD {index} {docId} {score}
[NOSAVE]
[REPLACE [PARTIAL]]
[REPLACE [PARTIAL] [NOCREATE]]
[LANGUAGE {language}]
[PAYLOAD {payload}]
[IF {condition}]
Expand Down Expand Up @@ -162,6 +162,10 @@ FT.ADD idx doc1 1.0 FIELDS title hello world
document. Also, if only non-indexable fields, score or payload are set - we do not do a full
re-indexing of the document, and this will be a lot faster.

- **NOCREATE** (only applicable with REPLACE): If set, the document is only updated
and reindexed if it already exists. If the document does not exist, an error
will be returned.

- **FIELDS**: Following the FIELDS specifier, we are looking for pairs of `{field} {value}` to be
indexed. Each field will be scored based on the index spec given in `FT.CREATE`.
Passing fields that are not in the index spec will make them be stored as part of the document,
Expand Down Expand Up @@ -271,7 +275,7 @@ OK on success, or an error if something went wrong.

---

## FT.ALTER
## FT.ALTER SCHEMA ADD

### Format

Expand All @@ -281,8 +285,7 @@ FT.ALTER {index} SCHEMA ADD {field} {options} ...

### Description

Alters an existing index. Currently, adding fields to the index is the only supported
alteration.
Adds a new field to the index.

Adding a field to the index will cause any future document updates to use the new field when
indexing. Existing documents will not be reindexed.
Expand Down Expand Up @@ -313,6 +316,35 @@ O(1)

OK or an error.


---

## FT.ALTER ALIAS ADD
## FT.ALTER ALIAS DEL

### Format

```
FT.ALTER {index} ALIAS ADD {alias}
FT.ALTER {index} ALIAS DEL {alias}
```

The `ALIAS ADD` and `ALIAS DEL` commands will add or remove an alias from
an index. Index aliases can be used to refer to actual indexes in data
commands such as `FT.SEARCH` or `FT.ADD`. This allows an administrator
to transparently redirect application queries to alternative indexes.

Indexes can have more than one alias, though an alias cannot refer to another
alias.

### Complexity

O(1)

### Returns

OK or an error.

---

## FT.INFO
Expand Down Expand Up @@ -690,6 +722,71 @@ String Response. A string representing the execution plan (see above example).

---

## FT.EXPLAINCLI

### Format

```
FT.EXPLAINCLI {index} {query}
```

### Description

Returns the execution plan for a complex query but formatted for easier reading without using `redis-cli --raw`.

In the returned response, a `+` on a term is an indication of stemming.

### Example
```sh
$ redis-cli

127.0.0.1:6379> FT.EXPLAINCLI rd "(foo bar)|(hello world) @date:[100 200]|@date:[500 +inf]"
1) INTERSECT {
2) UNION {
3) INTERSECT {
4) UNION {
5) foo
6) +foo(expanded)
7) }
8) UNION {
9) bar
10) +bar(expanded)
11) }
12) }
13) INTERSECT {
14) UNION {
15) hello
16) +hello(expanded)
17) }
18) UNION {
19) world
20) +world(expanded)
21) }
22) }
23) }
24) UNION {
25) NUMERIC {100.000000 <= @date <= 200.000000}
26) NUMERIC {500.000000 <= @date <= inf}
27) }
28) }
29)
```
### Parameters
- **index**: The index name. The index must be first created with FT.CREATE
- **query**: The query string, as if sent to FT.SEARCH
### Complexity
O(1)
### Returns
String Response. A string representing the execution plan (see above example).
---
## FT.DEL
### Format
Expand Down
2 changes: 1 addition & 1 deletion docs/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ You simply call `RedisModule_StringTruncate` to resize a memory chunk to the siz

We use this API in the module mainly to encode inverted indexes, and for other auxiliary data structures besides that.

A generic "Buffer" implementation using DMA strings can be found in [redis_buffer.c](https://github.com/RedisLabsModules/RediSearch/blob/master/src/redis_buffer.c). It automatically resizes the Redis string it uses as raw memory when the capacity needs to grow.
A generic "Buffer" implementation using DMA strings can be found in [redis_buffer.c](https://github.com/RediSearch/RediSearch/blob/master/src/redis_buffer.c). It automatically resizes the Redis string it uses as raw memory when the capacity needs to grow.

## Inverted index encoding

Expand Down
2 changes: 1 addition & 1 deletion docs/Extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Extensions should be compiled into .so files, and loaded into RediSearch on init

* Compiling

Extensions should be compiled and linked as dynamic libraries. An example Makefile for an extension [can be found here](https://github.com/RedisLabsModules/RediSearch/blob/master/src/tests/ext-example/Makefile).
Extensions should be compiled and linked as dynamic libraries. An example Makefile for an extension [can be found here](https://github.com/RediSearch/RediSearch/blob/master/src/tests/ext-example/Makefile).

That folder also contains an example extension that is used for testing and can be taken as a skeleton for implementing your own extension.

Expand Down
2 changes: 1 addition & 1 deletion docs/Query_Syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,4 @@ The supported attributes are:

## Technical note

The query parser is built using the Lemon Parser Generator and a Ragel based lexer. You can see the grammar definition [at the git repo](https://github.com/RedisLabsModules/RediSearch/blob/master/src/query_parser/parser.y).
The query parser is built using the Lemon Parser Generator and a Ragel based lexer. You can see the grammar definition [at the git repo](https://github.com/RediSearch/RediSearch/blob/master/src/query_parser/parser.y).
4 changes: 2 additions & 2 deletions docs/Quick_Start.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ download a precompiled binary from [CMake downloads](https://cmake.org/download/
To build using CMake:

```sh
git clone https://github.com/RedisLabsModules/RediSearch.git
git clone https://github.com/RediSearch/RediSearch.git
cd RediSearch
mkdir build
cd build
Expand All @@ -35,7 +35,7 @@ take care of running `cmake` with the appropriate arguments, and provide you
with a `redisearch.so` file in the `src` directory:

```sh
git clone https://github.com/RedisLabsModules/RediSearch.git
git clone https://github.com/RediSearch/RediSearch.git
cd RediSearch
make
redis-server --loadmodule ./src/redisearch.so
Expand Down
2 changes: 1 addition & 1 deletion docs/contrib.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Contributor agreement

Please refer to the following page for the agreement: [Redis Labs Software Grant and Contributor License Agreement](https://cla-assistant.io/RedisLabsModules/RediSearch)
Please refer to the following page for the agreement: [Redis Labs Software Grant and Contributor License Agreement](https://cla-assistant.io/RediSearch/RediSearch)
32 changes: 32 additions & 0 deletions docs/img/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/logo_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<center>![logo.png](logo.png)</center>
<img src="img/logo.svg" alt="logo" width="200"/>

# RediSearch - Redis Powered Search Engine

RediSearch is a source available Full-Text and Secondary Index engine over Redis, developed by [Redis Labs](http://redislabs.com).

!!! note "Quick Links:"
* [Source Code at GitHub](https://github.com/RedisLabsModules/RediSearch).
* [Latest Release](https://github.com/RedisLabsModules/RediSearch/releases)
* [Source Code at GitHub](https://github.com/RediSearch/RediSearch).
* [Latest Release](https://github.com/RediSearch/RediSearch/releases)
* [Docker Image: redislabs/redisearch](https://hub.docker.com/r/redislabs/redisearch/)
* [Quick Start Guide](Quick_Start.md)
* [Mailing list / Forum](https://groups.google.com/forum/#!forum/redisearch)
Expand Down
6 changes: 3 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
site_name: RediSearch Documentation
site_url: https://oss.redislabs.com/redisearch
repo_url: https://github.com/RedisLabsModules/RediSearch
repo_name: RedisLabsModules/RediSearch
repo_url: https://github.com/RediSearch/RediSearch
repo_name: RediSearch/RediSearch

google_analytics:
- 'UA-92003007-1'
Expand All @@ -17,7 +17,7 @@ use_directory_urls: false
theme:
name: 'material'
language: 'en'
logo: 'logo_small.png'
logo: 'img/logo_small.png'
favicon: 'img/favicon.png'
palette:
primary: 'indigo'
Expand Down
5 changes: 5 additions & 0 deletions src/aggregate/functions/function.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,9 @@ void RegisterAllFunctions() {
RegisterMathFunctions();
RegisterDateFunctions();
RegisterStringFunctions();
}

void FunctionRegistry_Free(void) {
free(functions_g.funcs);
memset(&functions_g, 0, sizeof(functions_g));
}
1 change: 1 addition & 0 deletions src/aggregate/functions/function.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ void RegisterStringFunctions();
void RegisterDateFunctions();
void RegisterAllFunctions();

void FunctionRegistry_Free(void);
#ifdef __cplusplus
}
#endif
Expand Down
Loading

0 comments on commit 2166c39

Please sign in to comment.