Browse Source

Merge branch 'master' into parallel_rt

klirichek 6 years ago
parent
commit
292b46ef2e
100 changed files with 706 additions and 767 deletions
  1. 20 0
      .github/stale.yml
  2. 1 0
      .gitlab-ci.yml
  3. 9 7
      CMakeLists.txt
  4. 1 1
      ISSUE_TEMPLATE.md
  5. 1 1
      README.md
  6. 1 1
      api/libsphinxclient/sphinxclient.c
  7. 1 7
      api/libsphinxclient/test.c
  8. 1 1
      cmake/FindICONV.cmake
  9. 1 1
      cmake/Findjemalloc.cmake
  10. 11 124
      cmake/GetICU.cmake
  11. 1 1
      cmake/GetMYSQL.cmake
  12. 1 1
      cmake/GetRE2.cmake
  13. 4 4
      cmake/GetStemmer.cmake
  14. 11 14
      cmake/builds/CommonDeb.cmake
  15. 24 17
      cmake/builds/CommonRpm.cmake
  16. 5 4
      cmake/builds/build_macos.cmake
  17. 7 6
      cmake/builds/build_macosbrew.cmake
  18. 1 1
      cmake/mincore_test.cmake
  19. 1 1
      contrib/scripts/searchd
  20. 1 1
      debian/copyright
  21. 2 2
      debian/postinst
  22. 1 1
      dist/deb/README.Debian.in
  23. 1 1
      dist/deb/conffiles.in
  24. 2 2
      dist/deb/manticore.generator.in
  25. 4 4
      dist/deb/manticore.init.in
  26. 2 2
      dist/deb/manticore.service.in
  27. 3 3
      dist/deb/manticore.upstart.in
  28. 20 20
      dist/deb/postinst.in
  29. 1 1
      dist/deb/postinst.xenial.in
  30. 5 5
      dist/rpm/manticore.generator.in
  31. 3 3
      dist/rpm/manticore.init.in
  32. 0 33
      dist/rpm/manticore.post
  33. 32 0
      dist/rpm/manticore.post.in
  34. 2 2
      dist/rpm/manticore.preun
  35. 2 2
      dist/rpm/manticore.service.in
  36. 0 35
      dist/rpm/manticore_s.post
  37. 33 0
      dist/rpm/manticore_s.post.in
  38. 1 1
      dist/rpm/manticore_s.postun
  39. 1 1
      dist/rpm/manticore_s.preun
  40. 1 1
      doc/indexer.1
  41. 5 5
      doc/manpages.xml
  42. 1 1
      doc/spelldump.1
  43. 6 6
      docs/command_line_tools_reference/index_converter_command_reference.rst
  44. 10 10
      docs/command_line_tools_reference/indexer_command_reference.rst
  45. 2 2
      docs/command_line_tools_reference/indextool_command_reference.rst
  46. 13 13
      docs/command_line_tools_reference/searchd_command_reference.rst
  47. 1 1
      docs/command_line_tools_reference/wordbreaker_command_reference.rst
  48. 2 2
      docs/conf.py
  49. 0 18
      docs/conf_options_reference/common_section_configuration_options.rst
  50. 10 8
      docs/conf_options_reference/index_configuration_options.rst
  51. 51 49
      docs/getting-started/docker.rst
  52. 3 45
      docs/getting-started/indexes.rst
  53. 54 51
      docs/getting-started/official-packages.rst
  54. 1 2
      docs/httpapi_reference.rst
  55. 3 3
      docs/indexing/attributes.rst
  56. 1 1
      docs/indexing/delta_index_updates.rst
  57. 1 1
      docs/indexing/sql_data_sources_mysql,_postgresql.rst
  58. 36 39
      docs/installation.rst
  59. 1 1
      docs/mysql_storage_engine_sphinxse.rst
  60. 34 35
      docs/real-time_indexes.rst
  61. 45 0
      docs/releasenotes.rst
  62. 0 4
      docs/replication.rst
  63. 1 1
      docs/reporting_bugs.rst
  64. 2 2
      docs/sphinxql_reference/alter_syntax.rst
  65. 1 1
      docs/sphinxql_reference/show_index_settings_syntax.rst
  66. 1 1
      libstemmer_c/README
  67. 2 0
      manticore-min.conf.in
  68. 6 8
      manticore.conf.in
  69. 9 1
      misc/ctest/gltest.cmake
  70. 7 1
      misc/ctest/justbuild.cmake
  71. 0 6
      mysqlse/ha_sphinx.h
  72. 0 8
      mysqlse/snippets_udf.cc
  73. 1 1
      src/accumulator.h
  74. 1 5
      src/attribute.cpp
  75. 1 8
      src/attribute.h
  76. 1 1
      src/charsets/globalaliases.h.in
  77. 1 5
      src/docstore.cpp
  78. 1 8
      src/docstore.h
  79. 1 1
      src/global_idf.cpp
  80. 1 1
      src/global_idf.h
  81. 1 1
      src/gtests/gtests_filter.cpp
  82. 1 1
      src/gtests/gtests_functions.cpp
  83. 1 1
      src/gtests/gtests_globalstate.cpp
  84. 1 1
      src/gtests/gtests_json.cpp
  85. 1 1
      src/gtests/gtests_pqstuff.cpp
  86. 1 1
      src/gtests/gtests_rtstuff.cpp
  87. 44 44
      src/icu.cpp
  88. 1 2
      src/icu.h
  89. 3 10
      src/index_converter.cpp
  90. 80 0
      src/indexcheck.cpp
  91. 4 0
      src/indexcheck.h
  92. 5 5
      src/indexer.cpp
  93. 1 1
      src/indextool.cpp
  94. 1 1
      src/literal.h.in
  95. 1 1
      src/replication/wsrep_api_stub.h
  96. 13 12
      src/searchd.cpp
  97. 1 1
      src/searchdaemon.cpp
  98. 3 6
      src/searchdexpr.cpp
  99. 1 5
      src/searchdfields.cpp
  100. 6 5
      src/searchdha.cpp

+ 20 - 0
.github/stale.yml

@@ -0,0 +1,20 @@
+# Number of days of inactivity before an issue becomes stale
+daysUntilStale: 30
+# Number of days of inactivity before a stale issue is closed
+daysUntilClose: 3
+# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
+onlyLabels:
+  - "waiting for reply"
+# Issues with these labels will never be considered stale
+exemptLabels:
+  - binlog
+# Comment to post when marking an issue as stale. Set to `false` to disable
+markComment: >
+  This issue has been automatically marked as stale because it has not had
+  recent activity. It will be closed if no further activity occurs. Thank you
+  for your contributions. Feel free to re-open the issue in case it becomes actual.
+# Comment to post when closing a stale issue. Set to `false` to disable
+closeComment: false
+limitPerRun: 1
+# Limit to only `issues` or `pulls`
+only: issues

+ 1 - 0
.gitlab-ci.yml

@@ -178,6 +178,7 @@ build_bsd:
     CTEST_BUILD_CONFIGURATION: "Debug"
     LIBS_BUNDLE: "/media/shared/bundle"
     USE_GALERA: 0
+    WITH_ICU: 0
     CTEST_CMAKE_GENERATOR: "Unix Makefiles"
   script:
     - mkdir build && cd build

+ 9 - 7
CMakeLists.txt

@@ -589,8 +589,9 @@ if ( WIN32 )
 	install ( DIRECTORY api doc contrib DESTINATION ${SHAREDIR}/doc COMPONENT doc )
 	install ( FILES example.sql DESTINATION ${SHAREDIR}/doc COMPONENT doc )
 	install ( DIRECTORY misc/stopwords DESTINATION ${SHAREDIR} COMPONENT doc )
+	install ( FILES ${ICU_SRC}/source/data/in/icudt65l.dat DESTINATION  ${SHAREDIR}/icu COMPONENT doc)
 
-	install ( FILES COPYING INSTALL sphinx.conf.in sphinx-min.conf.in
+	install ( FILES COPYING INSTALL manticore.conf.in manticore-min.conf.in
 			DESTINATION . COMPONENT config )
 	install ( DIRECTORY DESTINATION log COMPONENT config )
 	install ( DIRECTORY DESTINATION data COMPONENT config )
@@ -598,20 +599,21 @@ endif ()
 
 IF (NOT DISTR_BUILD AND NOT WIN32 )
 	SET ( BINPREFIX "usr/" )
-	file ( READ "sphinx-min.conf.in" _MINCONF )
+	file ( READ "manticore-min.conf.in" _MINCONF )
 	string ( REPLACE "@CONFDIR@/log/searchd.pid" "@RUNDIR@/searchd.pid" _MINCONF "${_MINCONF}" )
 	string ( REPLACE "@CONFDIR@/log" "@LOGDIR@" _MINCONF "${_MINCONF}" )
-	file ( WRITE "${MANTICORE_BINARY_DIR}/sphinx-min.conf.in" "${_MINCONF}" )
+	file ( WRITE "${MANTICORE_BINARY_DIR}/manticore-min.conf.in" "${_MINCONF}" )
 	unset ( _MINCONF )
 	set ( CONFDIR "${CMAKE_INSTALL_LOCALSTATEDIR}/lib/manticore" )
 	set ( RUNDIR "${CMAKE_INSTALL_LOCALSTATEDIR}/run/manticore" )
 	set ( LOGDIR "${CMAKE_INSTALL_LOCALSTATEDIR}/log/manticore" )
-	configure_file ( "sphinx.conf.in" "${MANTICORE_BINARY_DIR}/sphinx.conf" @ONLY )
+	configure_file ( "manticore.conf.in" "${MANTICORE_BINARY_DIR}/manticore.conf" @ONLY )
 
-	configure_file ( "${MANTICORE_BINARY_DIR}/sphinx-min.conf.in" "${MANTICORE_BINARY_DIR}/sphinx-min.conf.dist" @ONLY )
-	INSTALL ( FILES ${MANTICORE_BINARY_DIR}/sphinx-min.conf.dist
-                DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/sphinxsearch COMPONENT doc RENAME sphinx.conf )
+	configure_file ( "${MANTICORE_BINARY_DIR}/manticore-min.conf.in" "${MANTICORE_BINARY_DIR}/manticore-min.conf.dist" @ONLY )
+	INSTALL ( FILES ${MANTICORE_BINARY_DIR}/manticore-min.conf.dist
+                DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/manticoresearch COMPONENT doc RENAME manticore.conf )
 	install ( DIRECTORY misc/stopwords DESTINATION ${CMAKE_INSTALL_DATADIR}/${PACKAGE_NAME} COMPONENT doc)
+	install ( FILES ${ICU_SRC}/source/data/in/icudt65l.dat DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/${PACKAGE_NAME}/icu COMPONENT doc)
 
 	install ( DIRECTORY DESTINATION ${CMAKE_INSTALL_LOCALSTATEDIR}/lib/manticore/data COMPONENT applications)
 	install ( DIRECTORY DESTINATION ${CMAKE_INSTALL_LOCALSTATEDIR}/run/manticore COMPONENT applications )

+ 1 - 1
ISSUE_TEMPLATE.md

@@ -24,7 +24,7 @@ If you open a Github issue, it must be a bug or feature request and you need to
 
 **Steps to reproduce:**
 
-    Include a simple use case than can reproduce the problem, including the sphinx.conf, index files, queries etc.
+    Include a simple use case than can reproduce the problem, including the manticore.conf, index files, queries etc.
     1.
     2.
     3.

+ 1 - 1
README.md

@@ -81,7 +81,7 @@ cmake .. &&  make install
 
 For more details check [compiling](https://docs.manticoresearch.com/latest/html/installation.html#compiling-manticore-from-source). 
 ## Getting started
- The quick way to see Manticore in action is to use the sample RT index preconfigured in sphinx.conf.
+ The quick way to see Manticore in action is to use the sample RT index preconfigured in manticore.conf.
  Inserting data in a RT index is done using SphinxQL and in the same way as for a MySQL table
  
       $ mysql -h 127.0.0.1 -P 9306

+ 1 - 1
api/libsphinxclient/sphinxclient.c

@@ -1,7 +1,7 @@
 //
 // Copyright (c) 2001-2016, Andrew Aksyonoff
 // Copyright (c) 2008-2016, Sphinx Technologies Inc
-// Copyright (c) 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 // All rights reserved
 //
 // This program is free software; you can redistribute it and/or modify

+ 1 - 7
api/libsphinxclient/test.c

@@ -1,8 +1,5 @@
 //
-// $Id$
-//
-
-//
+// Copyright (c) 2017-2020, Manticoreee
 // Copyright (c) 2001-2016, Andrew Aksyonoff
 // Copyright (c) 2008-2016, Sphinx Technologies Inc
 // All rights reserved
@@ -523,6 +520,3 @@ int main ( int argc, char ** argv )
 	return 0;
 }
 
-//
-// $Id$
-//

+ 1 - 1
cmake/FindICONV.cmake

@@ -14,7 +14,7 @@
 
 #=============================================================================
 # Copyright 2015 Sphinx Technologies, Inc.
-# Copyright 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+# Copyright 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 #
 # Distributed under the OSI-approved BSD License (the "License");
 # see accompanying file Copyright.txt for details.

+ 1 - 1
cmake/Findjemalloc.cmake

@@ -13,7 +13,7 @@
 #   JEMALLOC_LIBRARIES    - libraries to link
 
 #=============================================================================
-# Copyright 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+# Copyright 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 #
 # Distributed under the OSI-approved BSD License (the "License");
 # see accompanying file Copyright.txt for details.

+ 11 - 124
cmake/GetICU.cmake

@@ -1,5 +1,5 @@
 #=============================================================================
-# Copyright 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+# Copyright 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 #
 # Distributed under the OSI-approved BSD License (the "License");
 # see accompanying file Copyright.txt for details.
@@ -18,56 +18,6 @@ set ( ICU_SRC "${MANTICORE_BINARY_DIR}/icu" )
 mark_as_advanced ( ICU_SRC ICU_LIBDIR )
 set ( ICUZIP "icu4c-65_1-src.tgz" )
 
-#set ( ICU_DEBUG ON )
-
-macro( try_icu )
-set ( NEED_ICU_FROMSOURCES 0 )
-find_package ( ICU COMPONENTS uc )
-if ( ICU_FOUND )
-
-	set ( USE_ICU 1 )
-	# check whether we will build ICU from sources ourselves
-	if ( WITH_ICU_FORCE_STATIC )
-		set ( NEED_ICU_FROMSOURCES 1 )
-		unset ( ICU_INCLUDE_DIRS )
-		unset ( ICU_LIBRARIES )
-		message ( STATUS "ICU as sys shared lib found, but need sources" )
-	else ()
-		message ( STATUS "ICU as sys shared library" )
-		set ( ICU_IS_SHARED 1 )
-		mark_as_advanced ( ICU_IS_SHARED )
-	endif ()
-else ()
-	set ( NEED_ICU_FROMSOURCES 1 )
-endif()
-mark_as_advanced(ICU_DERB_EXECUTABLE ICU_GENBRK_EXECUTABLE ICU_GENCCODE_EXECUTABLE
-		ICU_GENCFU_EXECUTABLE ICU_GENCMN_EXECUTABLE ICU_GENCNVAL_EXECUTABLE
-		ICU_GENDICT_EXECUTABLE ICU_GENNORM2_EXECUTABLE ICU_GENRB_EXECUTABLE
-		ICU_GENSPREP_EXECUTABLE ICU_ICU-CONFIG_EXECUTABLE ICU_ICUINFO_EXECUTABLE
-		ICU_ICUPKG_EXECUTABLE ICU_INCLUDE_DIR ICU_MAKECONV_EXECUTABLE ICU_MAKEFILE_INC
-		ICU_PKGDATA_EXECUTABLE ICU_PKGDATA_INC ICU_UCONV_EXECUTABLE)
-endmacro()
-
-set (STORED_ICU "${ICU_LIBRARIES}")
-try_icu()
-if ( NOT ICU_FOUND )
-	if ( APPLE )
-		set ( ICU_BREW /usr/local/opt/icu4c )
-		if ( EXISTS ${ICU_BREW} )
-			if ( NOT "$ENV{ICU_ROOT}" STREQUAL "${ICU_BREW}" )
-				message ( "Will retry with 'ICU_ROOT=${ICU_BREW}'" )
-				message ( "Use 'export ICU_ROOT=/path/to/icu/root' if you want to build with alternate ICU.")
-				set ( ENV{ICU_ROOT} "${ICU_BREW}" )
-				try_icu()
-			endif ()
-		else()
-			message ( "You can use brew-provided ICU by installing it with `brew install icu4c`" )
-			message ( "Then try to reconfigure and maybe provide env ICU_ROOT with the path to ICU folder." )
-		endif ()
-	endif ()
-endif()
-
-if ( NEED_ICU_FROMSOURCES )
 include ( FetchContent )
 # check whether we have local copy (to not disturb network)
 if ( LIBS_BUNDLE AND EXISTS "${LIBS_BUNDLE}/${ICUZIP}" )
@@ -111,84 +61,21 @@ if ( icu_POPULATED )
 	set ( ICU_INCLUDE_DIRS "${ICU_SRC}/source/common" )
 	set ( ICU_LIBRARIES icu )
 endif ()
-endif ( NEED_ICU_FROMSOURCES )
 
-if ( STORED_ICU AND NOT STORED_ICU STREQUAL "${ICU_LIBRARIES}" )
-	message (STATUS "EXPERIMENTAL! Use your provided ${STORED_ICU} instead of found ${ICU_LIBRARIES}")
-	set ( ICU_LIBRARIES "${STORED_ICU}" CACHE STRING "User-provided ICU library" FORCE )
+if ( WIN32 )
+	# FIXME! need a proper way to detect if CMAKE_INSTALL_DATADIR is not default
+	if ( NOT CMAKE_INSTALL_DATADIR STREQUAL "share" )
+		add_compile_definitions ( ICU_DATA_DIR="${CMAKE_INSTALL_DATADIR}/icu" )
+	else()
+		add_compile_definitions ( ICU_DATA_DIR="../share/icu" )
+	endif()
+else()
+	add_compile_definitions ( ICU_DATA_DIR="${CMAKE_INSTALL_FULL_DATADIR}/${PACKAGE_NAME}/icu" )
 endif()
 
 if ( USE_ICU )
 	include_directories ( ${ICU_INCLUDE_DIRS} )
-	if ( NOT ICU_IS_SHARED )
-		list ( APPEND EXTRA_LIBRARIES ${ICU_LIBRARIES} )
-	endif()
-endif()
-
-CMAKE_DEPENDENT_OPTION ( DL_ICU "load ICU library dynamically" ON "ICU_FOUND;HAVE_DLOPEN;ICU_IS_SHARED;USE_ICU" OFF )
-
-if ( DL_ICU )
-	if ( NOT ICU_CPP_FUNCS )
-		set ( ICU_FUNCS
-				BreakIterator::createWordInstance
-				utext_openUTF8
-				utext_close
-				Locale::getChinese
-				u_errorName
-				u_setDataDirectory )
-		include ( helpers )
-		GET_NAMES ( "${ICU_LIBRARIES}" ICU_FUNCS ICU_CPP_FUNCS ICU_RAW_FUNCS )
-	endif()
-
-	if ( NOT ICU_CPP_FUNCS )
-		SET ( DL_ICU 0 )
-		message (STATUS "Unable to extract functions from ICU lib, falling back to explicit linkage" )
-	else()
-
-		# set them into cache - to avoid run get_names in future.
-		set ( ICU_FUNCS "${ICU_FUNCS}" CACHE STRING "" )
-		set ( ICU_CPP_FUNCS "${ICU_CPP_FUNCS}" CACHE STRING "" )
-		set ( ICU_RAW_FUNCS "${ICU_RAW_FUNCS}" CACHE STRING "" )
-		mark_as_advanced ( ICU_FUNCS ICU_CPP_FUNCS ICU_RAW_FUNCS )
-
-		list ( LENGTH ICU_FUNCS NFUNCS )
-		math ( EXPR NFUNCS "${NFUNCS}-1" )
-		# prepare inclusion clause
-		SET (icui "${MANTICORE_BINARY_DIR}/config/ldicu.inl")
-		file (WRITE "${icui}" "// This is generated file. Look into GetICU.cmake for template\n\n")
-		foreach (_icuf RANGE ${NFUNCS})
-			list ( GET ICU_FUNCS ${_icuf} _icuff )
-			list ( GET ICU_CPP_FUNCS ${_icuf} _icufcpp )
-			file ( APPEND "${icui}" "static decltype ( &${_icufcpp} ) imp_${_icuff} = nullptr;\n" )
-		endforeach()
-
-		# InitDynamicIcu ()
-		file ( APPEND "${icui}" "\nbool InitDynamicIcu ()\n{\n\tconst char* sFuncs[] = {\n" )
-		foreach ( _icuf RANGE ${NFUNCS} )
-			list ( GET ICU_RAW_FUNCS ${_icuf} _icufr )
-			file ( APPEND "${icui}" "\t\t\"${_icufr}\",\n" )
-		endforeach ()
-		file ( APPEND "${icui}" "\n\t};\n\n\tvoid** pFuncs[] = {\n" )
-		foreach ( _icuf RANGE ${NFUNCS} )
-			list ( GET ICU_FUNCS ${_icuf} _icuff )
-			file ( APPEND "${icui}" "\t\t( void** ) &imp_${_icuff},\n" )
-		endforeach ()
-		file ( APPEND "${icui}" "\n\t};\n\n" )
-		file ( APPEND "${icui}" "\tstatic CSphDynamicLibrary dLib ( ICU_LIB );\n" )
-		file ( APPEND "${icui}" "\treturn dLib.LoadSymbols ( sFuncs, pFuncs, sizeof ( pFuncs ) / sizeof ( void** ));\n" )
-		file ( APPEND "${icui}" "}\n" )
-	endif()
+	list ( APPEND EXTRA_LIBRARIES ${ICU_LIBRARIES} )
 endif()
 
 memcfgvalues ( USE_ICU )
-memcfgvalues ( ICU_IS_SHARED )
-
-if ( DL_ICU )
-	set ( DL_ICU 1 )
-	GET_SONAME ( "${ICU_LIBRARIES}" ICU_LIB )
-	message ( STATUS "ICU will be loaded dynamically in runtime as ${ICU_LIB}" )
-	memcfgvalues ( DL_ICU ICU_LIB )
-else ( DL_ICU )
-	list ( APPEND EXTRA_LIBRARIES ${ICU_LIBRARIES} )
-	message ( STATUS "ICU will be linked as ${ICU_LIBRARIES}" )
-endif ()

+ 1 - 1
cmake/GetMYSQL.cmake

@@ -1,5 +1,5 @@
 #=============================================================================
-# Copyright 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+# Copyright 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 #
 # Distributed under the OSI-approved BSD License (the "License");
 # see accompanying file Copyright.txt for details.

+ 1 - 1
cmake/GetRE2.cmake

@@ -1,5 +1,5 @@
 #=============================================================================
-# Copyright 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+# Copyright 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 #
 # Distributed under the OSI-approved BSD License (the "License");
 # see accompanying file Copyright.txt for details.

+ 4 - 4
cmake/GetStemmer.cmake

@@ -1,5 +1,5 @@
 #=============================================================================
-# Copyright 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+# Copyright 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 #
 # Distributed under the OSI-approved BSD License (the "License");
 # see accompanying file Copyright.txt for details.
@@ -13,9 +13,9 @@
 # Then (if it is not found) it try to look into ${LIBS_BUNDLE} for file named 'libstemmer_c.tgz'
 # It is supposed, that file (if any) contains archive from snowball with stemmer's sources.
 # If no file found, it will try to fetch it from
-# http://snowball.tartarus.org/dist/libstemmer_c.tgz
+# https://snowballstem.org/dist/libstemmer_c.tgz
 
-set ( STEMMER_URL "http://snowball.tartarus.org/dist/libstemmer_c.tgz" )
+set ( STEMMER_URL "https://snowballstem.org/dist/libstemmer_c.tgz" )
 mark_as_advanced( STEMMER_URL)
 
 find_package ( stemmer )
@@ -71,7 +71,7 @@ if ( NEED_STEMMER_FROMSOURCES )
 	if ( NOT EXISTS "${STEMMER_BASEDIR}/CMakeLists.txt" )
 		message ( SEND_ERROR "missing libstemmer sources from libstemmer_c.
 Please download the C version of libstemmer library from
-http://snowball.tartarus.org/ and extract its sources over libstemmer_c/
+https://snowballstem.org/ and extract its sources over libstemmer_c/
 subdirectory in order to build Manticore with libstemmer support. Or
 install the package named like 'libstemmer-dev' using your favorite
 package manager." )

+ 11 - 14
cmake/builds/CommonDeb.cmake

@@ -26,22 +26,22 @@ if ( NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE )
 endif ()
 
 # block below used to patch the minconf and full conf for debian
-file ( READ "sphinx-min.conf.in" _MINCONF )
-file ( READ "sphinx.conf.in" _FULLCONF )
+file ( READ "manticore-min.conf.in" _MINCONF )
+file ( READ "manticore.conf.in" _FULLCONF )
 string ( REPLACE "@CONFDIR@/log/searchd.pid" "@RUNDIR@/searchd.pid" _MINCONF "${_MINCONF}" )
 string ( REPLACE "@CONFDIR@/log/searchd.pid" "@RUNDIR@/searchd.pid" _FULLCONF "${_FULLCONF}" )
 string ( REPLACE "@CONFDIR@/log" "@LOGDIR@" _FULLCONF "${_FULLCONF}" )
 string ( REPLACE "@CONFDIR@/log" "@LOGDIR@" _FULLCONF "${_FULLCONF}" )
-file ( WRITE "${MANTICORE_BINARY_DIR}/sphinx-min.conf.in" "${_MINCONF}" )
-file ( WRITE "${MANTICORE_BINARY_DIR}/sphinx.conf.in" "${_FULLCONF}" )
+file ( WRITE "${MANTICORE_BINARY_DIR}/manticore-min.conf.in" "${_MINCONF}" )
+file ( WRITE "${MANTICORE_BINARY_DIR}/manticore.conf.in" "${_FULLCONF}" )
 unset ( _MINCONF )
 unset ( _FULLCONF )
 
 set ( CONFDIR "${LOCALSTATEDIR}/lib/manticore" )
 set ( RUNDIR "${LOCALSTATEDIR}/run/manticore" )
 set ( LOGDIR "${LOCALSTATEDIR}/log/manticore" )
-configure_file ( "${MANTICORE_BINARY_DIR}/sphinx-min.conf.in" "${MANTICORE_BINARY_DIR}/sphinx-min.conf.dist" @ONLY )
-configure_file ( "${MANTICORE_BINARY_DIR}/sphinx.conf.in" "${MANTICORE_BINARY_DIR}/sphinx.conf.dist" @ONLY )
+configure_file ( "${MANTICORE_BINARY_DIR}/manticore-min.conf.in" "${MANTICORE_BINARY_DIR}/manticore-min.conf.dist" @ONLY )
+configure_file ( "${MANTICORE_BINARY_DIR}/manticore.conf.in" "${MANTICORE_BINARY_DIR}/manticore.conf.dist" @ONLY )
 
 
 string ( CONFIGURE "${POSTINST_SPECIFIC_IN}" POSTINST_SPECIFIC @ONLY )
@@ -67,8 +67,8 @@ set ( CPACK_COMPONENT_ADM_GROUP "bin" )
 set ( CPACK_COMPONENT_ADM_DISPLAY_NAME "Helper scripts" )
 
 # Copy a default configuration file
-INSTALL ( FILES ${MANTICORE_BINARY_DIR}/sphinx.conf.dist
-		DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/sphinxsearch COMPONENT doc RENAME sphinx.conf )
+INSTALL ( FILES ${MANTICORE_BINARY_DIR}/manticore.conf.dist
+		DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/manticoresearch COMPONENT doc RENAME manticore.conf )
 
 install ( FILES doc/indexer.1 doc/indextool.1 doc/searchd.1 doc/spelldump.1 doc/wordbreaker.1
 		DESTINATION usr/${CMAKE_INSTALL_MANDIR}/man1 COMPONENT doc )
@@ -89,6 +89,7 @@ install ( FILES "${MANTICORE_BINARY_DIR}/manticore.init"
         GROUP_EXECUTE GROUP_READ COMPONENT adm RENAME manticore )
 
 install ( DIRECTORY misc/stopwords DESTINATION usr/${CMAKE_INSTALL_DATADIR}/${PACKAGE_NAME} COMPONENT doc)
+install ( FILES ${ICU_SRC}/source/data/in/icudt65l.dat DESTINATION usr/${CMAKE_INSTALL_DATADIR}/${PACKAGE_NAME}/icu COMPONENT doc)
 
 install ( DIRECTORY DESTINATION ${CMAKE_INSTALL_LOCALSTATEDIR}/lib/manticore/data COMPONENT adm)
 install ( DIRECTORY DESTINATION ${CMAKE_INSTALL_LOCALSTATEDIR}/log/manticore COMPONENT adm )
@@ -99,11 +100,7 @@ set ( CPACK_COMPONENT_BIN_DESCRIPTION "Fast standalone full-text SQL search engi
  size-efficient and relevant fulltext search functions to other applications.
  Sphinx was specially designed to integrate well with SQL databases and
  scripting languages. Currently built-in data sources support fetching data
- either via direct connection to MySQL or PostgreSQL, or using XML pipe
- mechanism (a pipe to indexer in special XML-based format which Sphinx
- recognizes).
- .
- Sphinx is an acronym which is officially decoded as SQL Phrase Index." )
+ from  MySQL, PostgreSQL, any database supporting ODBC, XML and CSV files. " )
  
  set  ( CPACK_COMPONENT_CONVERTER_DESCRIPTION "This package provides the index_converter tool for Manticore Search. index_converter upgrade indexes created with Manticore Search 2.x to Manticore Search 3.x format." )
 
@@ -122,6 +119,6 @@ set ( CPACK_DEBIAN_BIN_PACKAGE_CONTROL_EXTRA "${MANTICORE_BINARY_DIR}/conffiles;
 set ( CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION "ON" )
 set ( CPACK_DEBIAN_BIN_PACKAGE_REPLACES "sphinxsearch" )
 
-set ( CONFFILEDIR "${SYSCONFDIR}/sphinxsearch" )
+set ( CONFFILEDIR "${SYSCONFDIR}/manticoresearch" )
 
 #set ( CPACK_DEBIAN_PACKAGE_DEBUG "ON" )

+ 24 - 17
cmake/builds/CommonRpm.cmake

@@ -49,7 +49,7 @@ client programs and libraries via SQL-like SphinxQL interface.")
 #set ( CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST "/usr/include" )
 set ( CPACK_RPM_BIN_USER_FILELIST
 		"%config(noreplace) %{_sysconfdir}/logrotate.d/manticore"
-		"%config(noreplace) %{_sysconfdir}/sphinx/sphinx.conf" )
+		"%config(noreplace) %{_sysconfdir}/manticoresearch/manticore.conf" )
 
 set ( CPACK_RPM_SPEC_MORE_DEFINE
 		"%define _scripts ${MANTICORE_BINARY_DIR}
@@ -63,12 +63,12 @@ set ( CPACK_COMPONENT_ADM_GROUP "bin" )
 set ( CPACK_COMPONENT_ADM_DISPLAY_NAME "Scripts and settings" )
 
 # block below used to patch the minconf - add a slash at the end of 'binlog_path' section
-file ( READ "sphinx-min.conf.in" _MINCONF LIMIT 10240 )
+file ( READ "manticore-min.conf.in" _MINCONF LIMIT 10240 )
 string ( REGEX REPLACE "(binlog_path[ \t]+\\=[ \t]+\\@CONFDIR\\@/data)" "\\1/" _MINCONF "${_MINCONF}" )
 string ( REGEX REPLACE "(log/searchd.pid)" "run/manticore/searchd.pid" _MINCONF "${_MINCONF}" )
 string ( REGEX REPLACE "(@CONFDIR@/log/)" "@CONFDIR@/log/manticore/" _MINCONF "${_MINCONF}" )
 string ( REGEX REPLACE "(@CONFDIR@/data/)" "@CONFDIR@/lib/manticore/" _MINCONF "${_MINCONF}" )
-file ( WRITE "${MANTICORE_BINARY_DIR}/sphinx-min.conf.in" "${_MINCONF}")
+file ( WRITE "${MANTICORE_BINARY_DIR}/manticore-min.conf.in" "${_MINCONF}")
 unset (_MINCONF)
 
 # this values set for correct substitution in configure files below
@@ -76,37 +76,42 @@ set ( CONFDIR "${LOCALSTATEDIR}" )
 set ( RUNDIR "${LOCALSTATEDIR}/run/manticore" )
 set ( LOGDIR "${LOCALSTATEDIR}/log/manticore" )
 
-configure_file ( "${MANTICORE_BINARY_DIR}/sphinx-min.conf.in" "${MANTICORE_BINARY_DIR}/sphinx-min.conf.dist" @ONLY )
-configure_file ( "sphinx.conf.in" "${MANTICORE_BINARY_DIR}/sphinx.conf.dist" @ONLY )
+configure_file ( "${MANTICORE_BINARY_DIR}/manticore-min.conf.in" "${MANTICORE_BINARY_DIR}/manticore-min.conf.dist" @ONLY )
+configure_file ( "manticore.conf.in" "${MANTICORE_BINARY_DIR}/manticore.conf.dist" @ONLY )
 
 configure_file ( "dist/rpm/manticore.logrotate.in" "${MANTICORE_BINARY_DIR}/manticore.logrotate" @ONLY )
 
+configure_file ( "${CMAKE_CURRENT_SOURCE_DIR}/dist/rpm/manticore_s.post.in"
+		"${MANTICORE_BINARY_DIR}/manticore_s.post" @ONLY )
+configure_file ( "${CMAKE_CURRENT_SOURCE_DIR}/dist/rpm/manticore.post.in"
+		"${MANTICORE_BINARY_DIR}/manticore.post" @ONLY )
+
 set ( SCR "${CMAKE_CURRENT_SOURCE_DIR}/dist/rpm" ) # a shortcut
 if ( WITH_SYSTEMD )
 	set ( CPACK_RPM_BIN_BUILDREQUIRES "systemd-units" )
-	set ( CPACK_RPM_BIN_POST_INSTALL_SCRIPT_FILE "${SCR}/manticore_s.post" )
+	set ( CPACK_RPM_BIN_POST_INSTALL_SCRIPT_FILE "${MANTICORE_BINARY_DIR}/manticore_s.post")
 	set ( CPACK_RPM_BIN_POST_UNINSTALL_SCRIPT_FILE "${SCR}/manticore_s.postun" )
 	set ( CPACK_RPM_BIN_PRE_UNINSTALL_SCRIPT_FILE "${SCR}/manticore_s.preun" )
 
-	configure_file ( "dist/rpm/manticore.tmpfiles.in" "${MANTICORE_BINARY_DIR}/searchd.conf" @ONLY )
+	configure_file ( "dist/rpm/manticore.tmpfiles.in" "${MANTICORE_BINARY_DIR}/manticore.conf" @ONLY )
 	configure_file ( "dist/rpm/manticore.generator.in" "${MANTICORE_BINARY_DIR}/manticore-search-generator" @ONLY )
-	install ( FILES ${MANTICORE_BINARY_DIR}/searchd.conf DESTINATION usr/lib/tmpfiles COMPONENT adm )
+	install ( FILES ${MANTICORE_BINARY_DIR}/manticore.conf DESTINATION usr/lib/tmpfiles.d COMPONENT adm )
 	install ( PROGRAMS ${MANTICORE_BINARY_DIR}/manticore-search-generator
 			DESTINATION usr/lib/systemd/system-generators COMPONENT adm )
 
 else ()
 	set ( CPACK_RPM_BIN_PACKAGE_REQUIRES_POST chkconfig )
 	set ( CPACK_RPM_BIN_PACKAGE_REQUIRES_PREUN "chkconfig, initscripts" )
-	set ( CPACK_RPM_BIN_POST_INSTALL_SCRIPT_FILE "${SCR}/manticore.post" )
+	set ( CPACK_RPM_BIN_POST_INSTALL_SCRIPT_FILE "${MANTICORE_BINARY_DIR}/manticore.post")
 	set ( CPACK_RPM_BIN_PRE_UNINSTALL_SCRIPT_FILE "${SCR}/manticore.preun" )
-	configure_file ( "dist/rpm/manticore.init.in" "${MANTICORE_BINARY_DIR}/searchd" @ONLY )
-	install ( PROGRAMS ${MANTICORE_BINARY_DIR}/searchd
+	configure_file ( "dist/rpm/manticore.init.in" "${MANTICORE_BINARY_DIR}/manticore" @ONLY )
+	install ( PROGRAMS ${MANTICORE_BINARY_DIR}/manticore
 			DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/rc.d/init.d COMPONENT adm )
 
 endif ()
-if (NOT NOAPI)
-install ( FILES ${MANTICORE_BINARY_DIR}/sphinx-min.conf.dist
-		${MANTICORE_BINARY_DIR}/sphinx.conf.dist
+
+install ( FILES ${MANTICORE_BINARY_DIR}/manticore-min.conf.dist
+		${MANTICORE_BINARY_DIR}/manticore.conf.dist
 		DESTINATION usr/${CMAKE_INSTALL_DOCDIR} COMPONENT doc )
 
 install ( FILES COPYING example.sql DESTINATION usr/${CMAKE_INSTALL_DOCDIR} COMPONENT doc )
@@ -116,7 +121,9 @@ install ( FILES doc/indexer.1 doc/indextool.1 doc/searchd.1 doc/spelldump.1
 		DESTINATION usr/${CMAKE_INSTALL_MANDIR}/man1 COMPONENT doc )
 
 install ( DIRECTORY misc/stopwords DESTINATION usr/${CMAKE_INSTALL_DATADIR}/${PACKAGE_NAME} COMPONENT doc )
+install ( FILES ${ICU_SRC}/source/data/in/icudt65l.dat DESTINATION usr/${CMAKE_INSTALL_DATADIR}/${PACKAGE_NAME}/icu COMPONENT doc)
 
+if (NOT NOAPI)
 install ( DIRECTORY api DESTINATION usr/${CMAKE_INSTALL_DATADIR}/manticore COMPONENT doc )
 endif()
 
@@ -124,12 +131,12 @@ endif()
 install ( FILES ${MANTICORE_BINARY_DIR}/manticore.logrotate
 		DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/logrotate.d COMPONENT adm RENAME manticore)
 
-install ( FILES ${MANTICORE_BINARY_DIR}/sphinx-min.conf.dist
-		DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/sphinx COMPONENT adm RENAME sphinx.conf )
+install ( FILES ${MANTICORE_BINARY_DIR}/manticore-min.conf.dist
+		DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/manticoresearch COMPONENT adm RENAME manticore.conf )
 
 install ( DIRECTORY DESTINATION ${CMAKE_INSTALL_LOCALSTATEDIR}/lib/manticore COMPONENT adm )
 install ( DIRECTORY DESTINATION ${CMAKE_INSTALL_LOCALSTATEDIR}/run/manticore COMPONENT adm )
 install ( DIRECTORY DESTINATION ${CMAKE_INSTALL_LOCALSTATEDIR}/log/manticore COMPONENT adm )
 
-set ( CONFFILEDIR "${CMAKE_INSTALL_SYSCONFDIR}/sphinx" )
+set ( CONFFILEDIR "${SYSCONFDIR}/manticoresearch" )
 

+ 5 - 4
cmake/builds/build_macos.cmake

@@ -11,21 +11,22 @@ set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch x86_64" )
 
 # generate config files
 set ( CONFDIR "." )
-configure_file ( "sphinx-min.conf.in" "${MANTICORE_BINARY_DIR}/sphinx-min.conf" @ONLY )
-configure_file ( "sphinx.conf.in" "${MANTICORE_BINARY_DIR}/sphinx.conf" @ONLY )
+configure_file ( "manticore-min.conf.in" "${MANTICORE_BINARY_DIR}/manticore-min.conf" @ONLY )
+configure_file ( "manticore.conf.in" "${MANTICORE_BINARY_DIR}/manticore.conf" @ONLY )
 
 # install specific stuff
 install ( DIRECTORY api doc docs contrib DESTINATION . COMPONENT doc )
 
 install ( FILES COPYING INSTALL example.sql
-			"${MANTICORE_BINARY_DIR}/sphinx-min.conf"
-			"${MANTICORE_BINARY_DIR}/sphinx.conf"
+			"${MANTICORE_BINARY_DIR}/manticore-min.conf"
+			"${MANTICORE_BINARY_DIR}/manticore.conf"
 		DESTINATION . COMPONENT doc )
 
 install ( DIRECTORY DESTINATION bin COMPONENT doc )
 install ( DIRECTORY DESTINATION data COMPONENT doc )
 install ( DIRECTORY DESTINATION log COMPONENT doc )
 install ( DIRECTORY misc/stopwords DESTINATION . COMPONENT doc )
+install ( FILES ${ICU_SRC}/source/data/in/icudt65l.dat DESTINATION icu COMPONENT doc)
 
 # package specific
 

+ 7 - 6
cmake/builds/build_macosbrew.cmake

@@ -9,21 +9,22 @@ set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch x86_64" )
 
 # generate config files
 
-file ( READ "sphinx-min.conf.in" _MINCONF )
+file ( READ "manticore-min.conf.in" _MINCONF )
 string ( REPLACE "@CONFDIR@/log/searchd.pid" "@RUNDIR@/searchd.pid" _MINCONF "${_MINCONF}" )
 string ( REPLACE "@CONFDIR@/log" "@LOGDIR@" _MINCONF "${_MINCONF}" )
-file ( WRITE "${MANTICORE_BINARY_DIR}/sphinx-min.conf.in" "${_MINCONF}" )
+file ( WRITE "${MANTICORE_BINARY_DIR}/manticore-min.conf.in" "${_MINCONF}" )
 unset ( _MINCONF )
 set ( CONFDIR "${CMAKE_INSTALL_LOCALSTATEDIR}/manticore" )
 set ( RUNDIR "${CMAKE_INSTALL_LOCALSTATEDIR}/run/manticore" )
 set ( LOGDIR "${CMAKE_INSTALL_LOCALSTATEDIR}/log/manticore" )
-configure_file ( "sphinx.conf.in" "${MANTICORE_BINARY_DIR}/sphinx.conf" @ONLY )
+configure_file ( "manticore.conf.in" "${MANTICORE_BINARY_DIR}/manticore.conf" @ONLY )
 
 # install specific stuff
-configure_file ( "${MANTICORE_BINARY_DIR}/sphinx-min.conf.in" "${MANTICORE_BINARY_DIR}/sphinx-min.conf.dist" @ONLY )
-INSTALL ( FILES ${MANTICORE_BINARY_DIR}/sphinx-min.conf.dist
-                DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/manticore COMPONENT doc RENAME sphinx.conf )
+configure_file ( "${MANTICORE_BINARY_DIR}/manticore-min.conf.in" "${MANTICORE_BINARY_DIR}/manticore-min.conf.dist" @ONLY )
+INSTALL ( FILES ${MANTICORE_BINARY_DIR}/manticore-min.conf.dist
+                DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/manticore COMPONENT doc RENAME manticore.conf )
 install ( DIRECTORY misc/stopwords DESTINATION ${CMAKE_INSTALL_DATADIR}/${PACKAGE_NAME} COMPONENT doc)
+install ( FILES ${ICU_SRC}/source/data/in/icudt65l.dat DESTINATION ${CMAKE_INSTALL_DATADIR}/${PACKAGE_NAME}/icu COMPONENT doc)
 
 # data and log dirs are created by brew formula
 

+ 1 - 1
cmake/mincore_test.cmake

@@ -15,7 +15,7 @@
 # and so, this special testing is necessary to successfully compile.
 #
 #=============================================================================
-# Copyright 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+# Copyright 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 #
 # Distributed under the OSI-approved BSD License (the "License");
 # see accompanying file Copyright.txt for details.

+ 1 - 1
contrib/scripts/searchd

@@ -15,7 +15,7 @@ SUDO_USER=searchd
 
 BASE_PATH=/release/search
 PID_FILE=$BASE_PATH/searchd.pid
-CONFIG_FILE=$BASE_PATH/sphinx.conf
+CONFIG_FILE=$BASE_PATH/manticore.conf
 
 EXEC_PATH=$BASE_PATH
 LOG_PATH=$EXEC_PATH

+ 1 - 1
debian/copyright

@@ -5,7 +5,7 @@ Source:https://manticoresearch.com/
 
 Files: *
 Copyright:
-   Copyright (c) 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+   Copyright (c) 2017-2020, Manticore Software LTD (http://manticoresearch.com)
    Copyright (c) 2001-2016 by Andrew Aksyonoff <[email protected]>
    Copyright (c) 2008-2016, Sphinx Technologies Inc
 License: GPL-2

+ 2 - 2
debian/postinst

@@ -14,7 +14,7 @@ fi
 DATADIR=/var/lib/manticore
 LOGDIR=/var/log/manticore
 RUNDIR=/var/run/manticore
-SYSCONFDIR=/etc/sphinxsearch
+SYSCONFDIR=/etc/manticoresearch
 chown manticore:manticore $DATADIR
 chown manticore:manticore $LOGDIR
 chown manticore:manticore $RUNDIR
@@ -37,7 +37,7 @@ echo ""
 echo "Manticore installed!"
 echo ""
 echo "To manage indexes:"
-echo "    editor /etc/sphinxsearch/sphinx.conf"
+echo "    editor /etc/manticoresearch/manticore.conf"
 echo ""
 echo "To rebuild all disk indexes:"
 echo "    sudo -u manticore indexer --all --rotate"

+ 1 - 1
dist/deb/README.Debian.in

@@ -3,6 +3,6 @@ Manticore
 
 searchd will start automatically however the default configuration does not supply
 any indexes. Therefore, searchd will not continue running. You have to edit
-@SYSCONFDIR@/sphinxsearch/sphinx.conf to get any meaningful mode of operation.
+@SYSCONFDIR@/manticoresearch/manticore.conf to get any meaningful mode of operation.
 
 Documentation is available in @DOCDIRFULL@.

+ 1 - 1
dist/deb/conffiles.in

@@ -1,4 +1,4 @@
 @SYSCONFDIR@/default/manticore
 @SYSCONFDIR@/init/manticore.conf
-@SYSCONFDIR@/sphinxsearch/sphinx.conf
+@SYSCONFDIR@/manticoresearch/manticore.conf
 @SYSCONFDIR@/init.d/manticore

+ 2 - 2
dist/deb/manticore.generator.in

@@ -61,8 +61,8 @@ PermissionsStartOnly=true
 ExecStartPre=/usr/bin/install -omanticore -gmanticore -m755 -d /var/run/manticore
 # Run ExecStart with User=manticore / Group=manticore
 Environment=LD_PRELOAD=$JEMALLOC_LOCATION
-ExecStart=/usr/bin/searchd --config /etc/sphinxsearch/sphinx.conf
-ExecStop=/usr/bin/searchd --config /etc/sphinxsearch/sphinx.conf --stopwait
+ExecStart=/usr/bin/searchd --config /etc/manticoresearch/manticore.conf
+ExecStop=/usr/bin/searchd --config /etc/manticoresearch/manticore.conf --stopwait
 KillMode=process
 KillSignal=SIGTERM
 SendSIGKILL=no

+ 4 - 4
dist/deb/manticore.init.in

@@ -22,7 +22,7 @@
 
 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 DAEMON=@BINDIRFULL@/searchd
-DAEMONOPTS='-c @SYSCONFDIR@/sphinxsearch/sphinx.conf'
+DAEMONOPTS='-c @SYSCONFDIR@/manticoresearch/manticoresearch.conf'
 NAME=manticore
 DESC=manticore
 
@@ -99,10 +99,10 @@ do_force_stop() {
 do_start() {
 	test -e @RUNDIR@ || install -m 755 -o root -d root @RUNDIR@
         # Check if we have the configuration file
-        if [ ! -f @SYSCONFDIR@/sphinxsearch/sphinx.conf ]; then
+        if [ ! -f @SYSCONFDIR@/manticoresearch/manticore.conf ]; then
             echo "\n"
-            echo "Please create an @SYSCONFDIR@/sphinxsearch/sphinx.conf configuration file."
-            echo "A template is provided as @SYSCONFDIR@/sphinxsearch/sphinx.conf.sample."
+            echo "Please create an @SYSCONFDIR@/manticoresearch/manticore.conf configuration file."
+            echo "A template is provided as @SYSCONFDIR@/manticoresearch/manticore.conf.sample."
             exit 1
         fi
 

+ 2 - 2
dist/deb/manticore.service.in

@@ -12,8 +12,8 @@ PermissionsStartOnly=true
 ExecStartPre=/bin/mkdir -p /var/run/manticore
 ExecStartPre=/bin/chown manticore.manticore @RUNDIR@
 # Run ExecStart with User=manticore / Group=manticore
-ExecStart=@BINDIRFULL@/searchd --config @SYSCONFDIR@/sphinxsearch/sphinx.conf
-ExecStop=@BINDIRFULL@/searchd --config @SYSCONFDIR@/sphinxsearch/sphinx.conf --stopwait
+ExecStart=@BINDIRFULL@/searchd --config @SYSCONFDIR@/manticoresearch/manticore.conf
+ExecStop=@BINDIRFULL@/searchd --config @SYSCONFDIR@/manticoresearch/manticore.conf --stopwait
 KillMode=process
 KillSignal=SIGTERM
 SendSIGKILL=no

+ 3 - 3
dist/deb/manticore.upstart.in

@@ -25,12 +25,12 @@ pre-start script
 	logger "To enable manticore, edit @SYSCONFDIR@/default/manticore and set START=yes"
 	exit 0
     fi
-    if [ ! -f @SYSCONFDIR@/sphinxsearch/sphinx.conf ]; then
-        logger "Please create an @SYSCONFDIR@/sphinxsearch/sphinx.conf configuration file."
+    if [ ! -f @SYSCONFDIR@/manticoresearch/manticore.conf ]; then
+        logger "Please create an @SYSCONFDIR@/manticoresearch/manticore.conf configuration file."
         logger "Templates are in the @DOCDIRFULL@/example-conf/ directory."
         exit 0
     fi
 end script
 
-exec start-stop-daemon --start --chuid $MANTICOREUSER --exec @BINDIRFULL@/searchd -- --nodetach -c @SYSCONFDIR@/sphinxsearch/sphinx.conf
+exec start-stop-daemon --start --chuid $MANTICOREUSER --exec @BINDIRFULL@/searchd -- --nodetach -c @SYSCONFDIR@/manticoresearch/manticore.conf
 

+ 20 - 20
dist/deb/postinst.in

@@ -13,13 +13,19 @@ if ! getent passwd manticore >/dev/null; then
 fi
 DATADIR=@LOCALSTATEDIR@/lib/manticore
 LOGDIR=@LOCALSTATEDIR@/log/manticore
-SYSCONFDIR=@SYSCONFDIR@/sphinxsearch
+SYSCONFDIR=@SYSCONFDIR@/manticoresearch
 chown manticore:manticore $DATADIR -R
 chown manticore:manticore $LOGDIR -R
 chown manticore:manticore $SYSCONFDIR -R
 
 case "$1" in
-    configure|abort-upgrade|abort-remove|abort-deconfigure)
+    configure)
+        if [ -f @SYSCONFDIR@/sphinxsearch/sphinx.conf ]; then
+	        echo "Moving existing configuration to new location..."
+		    mv @SYSCONFDIR@/sphinxsearch/sphinx.conf @SYSCONFDIR@/manticoresearch/manticore.conf
+	    fi
+	;;
+	abort-upgrade|abort-remove|abort-deconfigure)
     ;;
 
     *)
@@ -28,33 +34,27 @@ case "$1" in
     ;;
 esac
 
-#add manticore init script to system start
 
-#update-rc.d manticore defaults
+echo "Manticore Search (https://manticoresearch.com)"
 echo ""
-echo "Manticore installed!"
+echo "Getting Started with Manticore Search:"
+echo "  https://docs.manticoresearch.com/latest/html/getting-started.html"
 echo ""
-echo "To manage indexes:"
-echo "    editor @SYSCONFDIR@/sphinxsearch/sphinx.conf"
+echo "Learn Manticore with interactive courses:"
+echo "  https://play.manticoresearch.com/"
 echo ""
-echo "To rebuild all disk indexes:"
-echo "    sudo -u manticore indexer --all --rotate"
-echo ""
-echo "To start/stop search daemon:"
+echo "To start Manticore Search service:"
 if [ -x "/usr/bin/deb-systemd-helper" ]; then
-echo "    systemctl start/stop manticore"
+echo "  > systemctl start/stop manticore"
 else
-echo "    service manticore start/stop"
+echo "  > service manticore start/stop"
 fi
-echo "To query search daemon using MySQL client:"
-echo "    mysql -h 0 -P 9306"
-echo "    mysql> SELECT * FROM test1 WHERE MATCH('test');"
-echo ""
-echo "See the manual at docs.manticoresearch.com for details."
 echo ""
-echo "For commercial support please contact Manticore Software Ltd at"
-echo "https://manticoresearch.com/contact/"
+echo "Configuration file:"
+echo "  /etc/manticoresearch/manticore.conf"
 echo ""
+
+
 #start manticore service
 
 #invoke-rc.d manticore start

+ 1 - 1
dist/deb/postinst.xenial.in

@@ -1,5 +1,5 @@
 # Automatically added by build_xenial.cmake
-if [ " $1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
+if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
 	if [ -x "@SYSCONFDIR@/init.d/manticore" ]; then
 		update-rc.d manticore defaults >/dev/null
 	fi

+ 5 - 5
dist/rpm/manticore.generator.in

@@ -39,10 +39,10 @@ is_jemalloc() {
 
 is_jemalloc
 
-if [ ! -e /usr/lib/systemd/system/searchd.service ]; then
-	M_UNIT_FILE="/usr/lib/systemd/system/searchd.service"
+if [ ! -e /usr/lib/systemd/system/manticore.service ]; then
+	M_UNIT_FILE="/usr/lib/systemd/system/manticore.service"
 else
-	M_UNIT_FILE="$2/searchd.service"
+	M_UNIT_FILE="$2/manticore.service"
 fi
 
 if [ $jemalloc_preload ]; then 
@@ -61,8 +61,8 @@ PermissionsStartOnly=true
 ExecStartPre=/usr/bin/install -omanticore -gmanticore -m755 -d /var/run/manticore
 # Run ExecStart with User=manticore / Group=manticore
 Environment=LD_PRELOAD=$JEMALLOC_LOCATION
-ExecStart=/usr/bin/searchd --config /etc/sphinx/sphinx.conf
-ExecStop=/usr/bin/searchd --config /etc/sphinx/sphinx.conf --stopwait
+ExecStart=/usr/bin/searchd --config /etc/manticoresearch/manticore.conf
+ExecStop=/usr/bin/searchd --config /etc/manticoresearch/manticore.conf --stopwait
 KillMode=process
 KillSignal=SIGTERM
 SendSIGKILL=no

+ 3 - 3
dist/rpm/manticore.init.in

@@ -7,7 +7,7 @@
 #	       all search requests.
 
 ### BEGIN INIT INFO
-# Provides: searchd
+# Provides: manticore
 # Required-Start: $local_fs $network
 # Required-Stop: $local_fs $network
 # Should-Start: $remote_fs
@@ -24,8 +24,8 @@
 exec="@BINDIRFULL@/searchd"
 prog="searchd"
 user="manticore"
-config="@SYSCONFDIR@/sphinx/sphinx.conf"
-lockfile=/var/lock/subsys/searchd
+config="@SYSCONFDIR@/manticoresearch/manticore.conf"
+lockfile=/var/lock/subsys/manticore
 
 start() {
     [ -x $exec ] || exit 5

+ 0 - 33
dist/rpm/manticore.post

@@ -1,33 +0,0 @@
-# create user/group, and update permissions
-groupadd -r %{manticore_group} 2>/dev/null || true
-useradd -M -r -d /var/lib/sphinx -s /bin/bash -c "Manticore server" -g %{manticore_group} %{manticore_user} 2>/dev/null || true
-usermod -g %{manticore_group} %{manticore_user} 2>/dev/null || true
-chown -R %{manticore_user}:%{manticore_group} /var/lib/manticore /var/log/manticore /var/run/manticore
-
-if [ $1 == 1 ]; then
-    /sbin/chkconfig --add searchd
-fi
-
-# print some further pointers
-echo
-echo "Manticore installed!"
-echo "Now create a full-text index, start the search daemon, and you're all set."
-echo
-echo "To manage indexes:"
-echo "    editor %{_sysconfdir}/sphinx/sphinx.conf"
-echo
-echo "To rebuild all disk indexes:"
-echo "    sudo -u manticore indexer --all --rotate"
-echo
-echo "To start/stop search daemon:"
-echo "    service searchd start/stop"
-echo
-echo "To query search daemon using MySQL client:"
-echo "    mysql -h 0 -P 9306"
-echo "    mysql> SELECT * FROM test1 WHERE MATCH('test');"
-echo
-echo "See the manual at /usr/share/doc/manticore-%{version} for details."
-echo
-echo "For commercial support please contact Manticore Software Ltd at"
-echo "https://manticoresearch.com/contact/"
-echo

+ 32 - 0
dist/rpm/manticore.post.in

@@ -0,0 +1,32 @@
+# create user/group, and update permissions
+groupadd -r %{manticore_group} 2>/dev/null || true
+useradd -M -r -d /var/lib/sphinx -s /bin/bash -c "Manticore server" -g %{manticore_group} %{manticore_user} 2>/dev/null || true
+usermod -g %{manticore_group} %{manticore_user} 2>/dev/null || true
+chown -R %{manticore_user}:%{manticore_group} /var/lib/manticore /var/log/manticore /var/run/manticore
+
+if [ $1 == 1 ]; then
+    /sbin/chkconfig --add manticore
+fi
+
+if [ $1 == 2 ]; then
+        if [ -f @SYSCONFDIR@/sphinx/sphinx.conf ]; then
+	        echo "Moving existing configuration to new location..."
+		    mv @SYSCONFDIR@/sphinx/sphinx.conf @SYSCONFDIR@/manticoresearch/manticore.conf
+	    fi
+fi
+
+# print some further pointers
+echo "Manticore Search (https://manticoresearch.com)"
+echo 
+echo "Getting Started with Manticore Search:"
+echo "  https://docs.manticoresearch.com/latest/html/getting-started.html"
+echo ""
+echo "Learn Manticore with interactive courses:"
+echo "  https://play.manticoresearch.com/"
+echo ""
+echo "To start Manticore Search service:"
+echo "  > service manticore start/stop"
+echo ""
+echo "Configuration file:"
+echo "  /etc/manticoresearch/manticore.conf"
+echo ""

+ 2 - 2
dist/rpm/manticore.preun

@@ -1,4 +1,4 @@
 if [ "$1" = 0 ] ; then
-    /sbin/service searchd stop >/dev/null 2>&1
-    /sbin/chkconfig --del searchd
+    /sbin/service manticore stop >/dev/null 2>&1
+    /sbin/chkconfig --del manticore
 fi

+ 2 - 2
dist/rpm/manticore.service.in

@@ -12,8 +12,8 @@ PermissionsStartOnly=true
 ExecStartPre=/bin/mkdir -p /var/run/manticore
 ExecStartPre=/bin/chown manticore.manticore @RUNDIR@
 # Run ExecStart with User=manticore / Group=manticore
-ExecStart=@BINDIRFULL@/searchd --config @SYSCONFDIR@/sphinx/sphinx.conf
-ExecStop=@BINDIRFULL@/searchd --config @SYSCONFDIR@/sphinx/sphinx.conf --stopwait
+ExecStart=@BINDIRFULL@/searchd --config @SYSCONFDIR@/manticoresearch/manticore.conf
+ExecStop=@BINDIRFULL@/searchd --config @SYSCONFDIR@/manticoresearch/manticore.conf --stopwait
 KillMode=process
 KillSignal=SIGTERM
 SendSIGKILL=no

+ 0 - 35
dist/rpm/manticore_s.post

@@ -1,35 +0,0 @@
-# create user/group, and update permissions
-groupadd -r %{manticore_group} 2>/dev/null || true
-useradd -M -r -d /var/lib/sphinx -s /bin/bash -c "Manticore server" -g %{manticore_group} %{manticore_user} 2>/dev/null || true
-usermod -g %{manticore_group} %{manticore_user} 2>/dev/null || true
-chown -R %{manticore_user}:%{manticore_group} /var/lib/manticore /var/log/manticore /var/run/manticore
-
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-%systemd_post searchd.service
-if [ $1 == 1 ]; then
-    /usr/bin/systemctl enable searchd >/dev/null 2>&1 || :
-	systemd-tmpfiles --create /usr/lib/tmpfiles.d/searchd.conf
-fi
-# print some further pointers
-echo
-echo "Manticore installed!"
-echo "Now create a full-text index, start the search daemon, and you're all set."
-echo
-echo "To manage indexes:"
-echo "    editor %{_sysconfdir}/sphinx/sphinx.conf"
-echo
-echo "To rebuild all disk indexes:"
-echo "    sudo -u manticore indexer --all --rotate"
-echo
-echo "To start/stop search daemon:"
-echo "    systemctl start/stop searchd"
-echo
-echo "To query search daemon using MySQL client:"
-echo "    mysql -h 0 -P 9306"
-echo "    mysql> SELECT * FROM test1 WHERE MATCH('test');"
-echo
-echo "See the manual at /usr/share/doc/manticore-%{version} for details."
-echo
-echo "For commercial support please contact Manticore Software Ltd at"
-echo "https://manticoresearch.com/contact/"
-echo

+ 33 - 0
dist/rpm/manticore_s.post.in

@@ -0,0 +1,33 @@
+# create user/group, and update permissions
+groupadd -r %{manticore_group} 2>/dev/null || true
+useradd -M -r -d /var/lib/sphinx -s /bin/bash -c "Manticore server" -g %{manticore_group} %{manticore_user} 2>/dev/null || true
+usermod -g %{manticore_group} %{manticore_user} 2>/dev/null || true
+chown -R %{manticore_user}:%{manticore_group} /var/lib/manticore /var/log/manticore /var/run/manticore
+
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+%systemd_post manticore.service
+if [ $1 == 1 ]; then
+    /usr/bin/systemctl enable manticore >/dev/null 2>&1 || :
+	systemd-tmpfiles --create /usr/lib/tmpfiles.d/searchd.conf
+fi
+if [ $1 == 2 ]; then
+        if [ -f @SYSCONFDIR@/sphinx/sphinx.conf ]; then
+	        echo "Moving existing configuration to new location..."
+		    mv @SYSCONFDIR@/sphinx/sphinx.conf @SYSCONFDIR@/manticoresearch/manticore.conf
+	    fi
+fi
+# print some further pointers
+echo "Manticore Search (https://manticoresearch.com)"
+echo 
+echo "Getting Started with Manticore Search:"
+echo "  https://docs.manticoresearch.com/latest/html/getting-started.html"
+echo 
+echo "Learn Manticore with interactive courses:"
+echo "  https://play.manticoresearch.com/"
+echo 
+echo "To start Manticore Search service:"
+echo "  > systemctl start manticore"
+echo 
+echo "Configuration file:"
+echo "  /etc/manticoresearch/manticore.conf"
+echo 

+ 1 - 1
dist/rpm/manticore_s.postun

@@ -1 +1 @@
-%systemd_postun searchd.service
+%systemd_postun manticore.service

+ 1 - 1
dist/rpm/manticore_s.preun

@@ -1 +1 @@
-%systemd_preun searchd.service
+%systemd_preun manticore.service

+ 1 - 1
doc/indexer.1

@@ -380,7 +380,7 @@ show version information of your particular build of
 Manticore Software LTD (http://manticoresearch\&.com)
 .SH "COPYRIGHT"
 .PP
-Copyright 2017\-2019 Manticore Software LTD (http://manticoresearch\&.com), 2008\-2016 Sphinx Technologies Inc (http://sphinxsearch\&.com), 2001\-2016 Andrew Aksyonoff
+Copyright 2017\-2020 Manticore Software LTD (http://manticoresearch\&.com), 2008\-2016 Sphinx Technologies Inc (http://sphinxsearch\&.com), 2001\-2016 Andrew Aksyonoff
 .PP
 Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation\&.
 .SH "SEE ALSO"

+ 5 - 5
doc/manpages.xml

@@ -442,7 +442,7 @@ $ indexer mysmallindex mybigindex</programlisting>
 
     <refsect1>
 		<title>Copyright</title>
-		<para>Copyright  2017-2019 Manticore Software LTD (http://manticoresearch.com),
+		<para>Copyright  2017-2020 Manticore Software LTD (http://manticoresearch.com),
 		2008-2016 Sphinx Technologies Inc (http://sphinxsearch.com),
 		2001-2016 Andrew Aksyonoff</para>
 		<para>Permission is granted to copy, distribute and/or modify this document
@@ -916,7 +916,7 @@ $ searchd --config /home/myuser/sphinx.conf --status</programlisting>
 
     <refsect1>
 		<title>Copyright</title>
-		<para>Copyright  2017-2019 Manticore Software LTD (http://manticoresearch.com),
+		<para>Copyright  2017-2020 Manticore Software LTD (http://manticoresearch.com),
 		2008-2016 Sphinx Technologies Inc (http://sphinxsearch.com),
 		2001-2016 Andrew Aksyonoff</para>
 		<para>Permission is granted to copy, distribute and/or modify this document
@@ -1040,7 +1040,7 @@ zoning &gt; zoning </programlisting></para>
 
     <refsect1>
 		<title>Copyright</title>
-		<para>Copyright  2017-2019 Manticore Software LTD (http://manticoresearch.com),
+		<para>Copyright  2017-2020 Manticore Software LTD (http://manticoresearch.com),
 		2008-2016 Sphinx Technologies Inc (http://sphinxsearch.com),
 		2001-2016 Andrew Aksyonoff</para>
 		<para>Permission is granted to copy, distribute and/or modify this document
@@ -1273,7 +1273,7 @@ zoning &gt; zoning </programlisting></para>
 
     <refsect1>
 		<title>Copyright</title>
-		<para>Copyright  2017-2019 Manticore Software LTD (http://manticoresearch.com),
+		<para>Copyright  2017-2020 Manticore Software LTD (http://manticoresearch.com),
 		2008-2016 Sphinx Technologies Inc (http://sphinxsearch.com),
 		2001-2016 Andrew Aksyonoff</para>
 		<para>Permission is granted to copy, distribute and/or modify this document
@@ -1402,7 +1402,7 @@ zoning &gt; zoning </programlisting></para>
 
     <refsect1>
 		<title>Copyright</title>
-		<para>Copyright  2017-2019 Manticore Software LTD (http://manticoresearch.com),
+		<para>Copyright  2017-2020 Manticore Software LTD (http://manticoresearch.com),
 		2008-2016 Sphinx Technologies Inc (http://sphinxsearch.com),
 		2001-2016 Andrew Aksyonoff</para>
 		<para>Permission is granted to copy, distribute and/or modify this document

+ 1 - 1
doc/spelldump.1

@@ -88,7 +88,7 @@ specifies a file for case conversion details\&.
 Manticore Software LTD (http://manticoresearch\&.com)
 .SH "COPYRIGHT"
 .PP
-Copyright 2017\-2019 Manticore Software LTD (http://manticoresearch\&.com), 2008\-2016 Sphinx Technologies Inc (http://sphinxsearch\&.com), 2001\-2016 Andrew Aksyonoff
+Copyright 2017\-2020 Manticore Software LTD (http://manticoresearch\&.com), 2008\-2016 Sphinx Technologies Inc (http://sphinxsearch\&.com), 2001\-2016 Andrew Aksyonoff
 .PP
 Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation\&.
 .SH "SEE ALSO"

+ 6 - 6
docs/command_line_tools_reference/index_converter_command_reference.rst

@@ -11,13 +11,13 @@ Convert one index at a time:
 
 .. code-block:: bash
 
-    $ index_converter --config /home/myuser/sphinx.conf --index indexname
+    $ index_converter --config /home/myuser/manticore.conf --index indexname
 
 Convert all indexes:
 
 .. code-block:: bash
 
-    $ index_converter --config /home/myuser/sphinx.conf --all
+    $ index_converter --config /home/myuser/manticore.conf --all
 
 Convert indexes found in a folder:
 
@@ -32,7 +32,7 @@ You can save the new index version to a different folder using `--output-dir` op
 
 .. code-block:: bash
 
-    $ index_converter --config /home/myuser/sphinx.conf --all --output-dir /new/path
+    $ index_converter --config /home/myuser/manticore.conf --all --output-dir /new/path
 
 A special case is for indexes containing kill-lists. As the behaviour of how kill-lists works has changed (see :ref:`killlist_target`), the delta index should know which are the target indexes for applying the kill-lists
 There are 3 ways to have a converted index ready for setting targeted indexes for applying kill-lists:
@@ -41,7 +41,7 @@ There are 3 ways to have a converted index ready for setting targeted indexes fo
 
 .. code-block:: bash
 
-    $ index_converter --config /home/myuser/sphinx.conf --index deltaindex --killlist-target mainindex:kl
+    $ index_converter --config /home/myuser/manticore.conf --index deltaindex --killlist-target mainindex:kl
 
 - Add killlist_target in the configuration before doing the conversion
 
@@ -51,8 +51,8 @@ A complete list of ``index_converter`` options:
 
 -  ``--config <file>`` (``-c <file>`` for short) tells
    ``index_converter`` to use the given file as its configuration. Normally, it
-   will look for ``sphinx.conf`` in the installation directory (e.g.
-   ``/usr/local/sphinx/etc/sphinx.conf`` if installed into
+   will look for ``manticore.conf`` in the installation directory (e.g.
+   ``/usr/local/sphinx/etc/manticore.conf`` if installed into
    ``/usr/local/sphinx``), followed by the current directory you are in
    when calling ``index_converter`` from the shell.
 

+ 10 - 10
docs/command_line_tools_reference/indexer_command_reference.rst

@@ -16,11 +16,11 @@ The calling syntax for ``indexer`` is as follows:
     indexer [OPTIONS] [indexname1 [indexname2 [...]]]
 
 Essentially you would list the different possible indexes (that you
-would later make available to search) in ``sphinx.conf``, so when
+would later make available to search) in ``manticore.conf``, so when
 calling ``indexer``, as a minimum you need to be telling it what index
 (or indexes) you want to index.
 
-If ``sphinx.conf`` contained details on 2 indexes, ``mybigindex`` and
+If ``manticore.conf`` contained details on 2 indexes, ``mybigindex`` and
 ``mysmallindex``, you could do the following:
 
 .. code-block:: bash
@@ -29,7 +29,7 @@ If ``sphinx.conf`` contained details on 2 indexes, ``mybigindex`` and
     $ indexer mybigindex
     $ indexer mysmallindex mybigindex
 
-As part of the configuration file, ``sphinx.conf``, you specify one or
+As part of the configuration file, ``manticore.conf``, you specify one or
 more indexes for your data. You might call ``indexer`` to reindex one of
 them, ad-hoc, or you can tell it to process all indexes - you are not
 limited to calling just one, or all at once, you can always pick some
@@ -60,24 +60,24 @@ operation is performed. These options are:
 
 -  ``--config <file>`` (``-c <file>`` for short) tells
    ``indexer`` to use the given file as its configuration. Normally, it
-   will look for ``sphinx.conf`` in the installation directory (e.g.
-   ``/usr/local/sphinx/etc/sphinx.conf`` if installed into
+   will look for ``manticore.conf`` in the installation directory (e.g.
+   ``/usr/local/sphinx/etc/manticore.conf`` if installed into
    ``/usr/local/sphinx``), followed by the current directory you are in
    when calling ``indexer`` from the shell. This is most of use in
    shared environments where the binary files are installed somewhere
    like ``/usr/local/sphinx/`` but you want to provide users with the
    ability to make their own custom Manticore set-ups, or if you want to
    run multiple instances on a single server. In cases like those you
-   could allow them to create their own ``sphinx.conf`` files and pass
+   could allow them to create their own ``manticore.conf`` files and pass
    them to ``indexer`` with this option. For example:
 
    .. code-block:: bash
 
 
-       $ indexer --config /home/myuser/sphinx.conf myindex
+       $ indexer --config /home/myuser/manticore.conf myindex
 
 -  ``--all`` tells ``indexer`` to update every index listed in
-   ``sphinx.conf``, instead of listing individual indexes. This would be
+   ``manticore.conf``, instead of listing individual indexes. This would be
    useful in small configurations, or ``cron``-type or maintenance jobs
    where the entire index set will get rebuilt each day, or week, or
    whatever period is best. Example usage:
@@ -85,7 +85,7 @@ operation is performed. These options are:
    .. code-block:: bash
 
 
-       $ indexer --config /home/myuser/sphinx.conf --all
+       $ indexer --config /home/myuser/manticore.conf --all
 
 -  ``--rotate`` is used for rotating indexes. Unless you have the
    situation where you can take the search function offline without
@@ -280,4 +280,4 @@ operation is performed. These options are:
    called in your particular build of ``indexer``.
 
 -  ``-v`` show version information of your particular build of ``indexer``.
-   
+   

+ 2 - 2
docs/command_line_tools_reference/indextool_command_reference.rst

@@ -48,7 +48,7 @@ The commands are as follows:
    particular the entire attribute and field list.
 
 -  ``--dumpconfig FILENAME.sph`` dumps the index definition from the
-   given index header file in (almost) compliant ``sphinx.conf`` file
+   given index header file in (almost) compliant ``manticore.conf`` file
    format.
 
 -  ``--dumpheader INDEXNAME`` dumps index header by index name with
@@ -74,7 +74,7 @@ The commands are as follows:
 
 -  ``--htmlstrip INDEXNAME`` filters stdin using HTML stripper settings
    for a given index, and prints the filtering results to stdout. Note
-   that the settings will be taken from sphinx.conf, and not the index
+   that the settings will be taken from manticore.conf, and not the index
    header.
 
 -  ``--mergeidf NODE1.idf [NODE2.idf ...] --out GLOBAL.idf`` merge several .idf files into a single one.

+ 13 - 13
docs/command_line_tools_reference/searchd_command_reference.rst

@@ -32,7 +32,7 @@ The options available to ``searchd`` on all builds are:
    ``indexer`` above.
 
 -  ``--stop`` is used to asynchronously stop ``searchd``, using the
-   details of the PID file as specified in the ``sphinx.conf`` file, so
+   details of the PID file as specified in the ``manticore.conf`` file, so
    you may also need to confirm to ``searchd`` which configuration file
    to use with the ``--config`` option. NB, calling ``--stop`` will also
    make sure any changes applied to the indexes with
@@ -42,7 +42,7 @@ The options available to ``searchd`` on all builds are:
    .. code-block:: bash
 
 
-       $ searchd --config /home/myuser/sphinx.conf --stop
+       $ searchd --config /home/myuser/manticore.conf --stop
 
 -  ``--stopwait`` is used to synchronously stop ``searchd``. ``--stop``
    essentially tells the running instance to exit (by sending it a
@@ -54,7 +54,7 @@ The options available to ``searchd`` on all builds are:
    .. code-block:: bash
 
 
-       $ searchd --config /home/myuser/sphinx.conf --stopwait
+       $ searchd --config /home/myuser/manticore.conf --stopwait
 
    Possible exit codes are as follows:
 
@@ -79,7 +79,7 @@ The options available to ``searchd`` on all builds are:
 
 
        $ searchd --status
-       $ searchd --config /home/myuser/sphinx.conf --status
+       $ searchd --config /home/myuser/manticore.conf --status
 
 -  ``--pidfile`` is used to explicitly force using a PID file (where the
    ``searchd`` process number is stored) despite any other debugging
@@ -94,7 +94,7 @@ The options available to ``searchd`` on all builds are:
 -  ``--console`` is used to force ``searchd`` into console mode;
    typically it will be running as a conventional server application,
    and will aim to dump information into the log files (as specified in
-   ``sphinx.conf``). Sometimes though, when debugging issues in the
+   ``manticore.conf``). Sometimes though, when debugging issues in the
    configuration or the daemon itself, or trying to diagnose
    hard-to-track-down problems, it may be easier to force it to dump
    information directly to the console/command line from which it is
@@ -106,7 +106,7 @@ The options available to ``searchd`` on all builds are:
    .. code-block:: bash
 
 
-       $ searchd --config /home/myuser/sphinx.conf --console
+       $ searchd --config /home/myuser/manticore.conf --console
 
 -  ``--logdebug``, ``--logreplication``, ``--logdebugv``, and ``--logdebugvv`` options enable
    additional debug output in the daemon log. They differ by the logging
@@ -116,7 +116,7 @@ The options available to ``searchd`` on all builds are:
    assist with some particularly complicated debugging session.)
 
 -  ``--iostats`` is used in conjunction with the logging options (the
-   ``query_log`` will need to have been activated in ``sphinx.conf``) to
+   ``query_log`` will need to have been activated in ``manticore.conf``) to
    provide more detailed information on a per-query basis as to the
    input/output operations carried out in the course of that query, with
    a slight performance hit and of course bigger logs. 
@@ -132,7 +132,7 @@ The options available to ``searchd`` on all builds are:
    .. code-block:: bash
 
 
-       $ searchd --config /home/myuser/sphinx.conf --iostats
+       $ searchd --config /home/myuser/manticore.conf --iostats
 
 -  ``--cpustats`` is used to provide actual CPU time report (in addition
    to wall time) in both query log file (for every given query) and
@@ -143,7 +143,7 @@ The options available to ``searchd`` on all builds are:
    .. code-block:: bash
 
 
-       $ searchd --config /home/myuser/sphinx.conf --cpustats
+       $ searchd --config /home/myuser/manticore.conf --cpustats
 
 -  ``--port portnumber`` (``-p`` for short) is used to specify the port
    that ``searchd`` should listen on, usually for debugging purposes.
@@ -213,7 +213,7 @@ The options available to ``searchd`` on all builds are:
    .. code-block:: bash
 
 
-       $ searchd --config /home/myuser/sphinx.conf --coredump
+       $ searchd --config /home/myuser/manticore.conf --coredump
 
 -  ``--new-cluster`` bootstraps a replication cluster and makes the daemon a
    reference node with :ref:`cluster restart <replication_restart>` protection
@@ -244,7 +244,7 @@ you install it as a service.
 
 
        C:\WINDOWS\system32> C:\Manticore\bin\searchd.exe --install
-          --config C:\Manticore\sphinx.conf
+          --config C:\Manticore\manticore.conf
 
    If you want to have the I/O stats every time you start
    ``searchd``, you need to specify its option on the same line as the
@@ -254,7 +254,7 @@ you install it as a service.
 
 
        C:\WINDOWS\system32> C:\Manticore\bin\searchd.exe --install
-          --config C:\Manticore\sphinx.conf --iostats
+          --config C:\Manticore\manticore.conf --iostats
 
 -  ``--delete`` removes the service from the Microsoft Management
    Console and other places where services are registered, after
@@ -286,7 +286,7 @@ you install it as a service.
 
 
        C:\WINDOWS\system32> C:\Manticore\bin\searchd.exe --install
-          --config C:\Manticore\sphinx.conf --servicename ManticoreSearch
+          --config C:\Manticore\manticore.conf --servicename ManticoreSearch
 
 -  ``--ntservice`` is the option that is passed by the Management
    Console to ``searchd`` to invoke it as a service on Windows

+ 1 - 1
docs/command_line_tools_reference/wordbreaker_command_reference.rst

@@ -34,7 +34,7 @@ using the ``indexer`` tool, as in
 .. code-block:: bash
 
 
-    indexer --buildstops dict.txt 100000 --buildfreqs myindex -c /path/to/sphinx.conf
+    indexer --buildstops dict.txt 100000 --buildfreqs myindex -c /path/to/manticore.conf
 
 which will write the 100,000 most frequent words, along with their
 counts, from myindex into dict.txt. The output file is a text file, so

+ 2 - 2
docs/conf.py

@@ -29,8 +29,8 @@ html_theme_options = {
 master_doc = 'index'
 source_suffix = '.rst'
 project = u'Manticore Search'
-copyright = u'2017-2019, Manticore Search team'
-version = '3.2.0'
+copyright = u'2017-2020, Manticore Search team'
+version = '3.2.2'
 release = version
 exclude_patterns = ['_build', 'html', 'doctrees']
 pygments_style = 'sphinx'

+ 0 - 18
docs/conf_options_reference/common_section_configuration_options.rst

@@ -120,21 +120,3 @@ Example:
 
 
     plugin_dir = /usr/local/sphinx/lib
-
-
-.. _icu_data_dir:
-
-icu_data_dir
-~~~~~~~~~~~~~~~
-
-A folder that contains data used by ICU to segment Chinese text. Should only be specified if you've built
-ICU from sources. If ICU is loaded as a dynamic library (supplied in a package provided by us,
-e.g. ``libicu_dev``), it doesn't require any external data. This folder must contain a .dat file (e.g. ``icudt64l.dat``).
-
-Example:
-
-
-.. code-block:: ini
-
-
-    icu_data_dir = /home/myuser/icu_data

+ 10 - 8
docs/conf_options_reference/index_configuration_options.rst

@@ -2065,12 +2065,9 @@ other morphology processors specified in the "morphology" option are applied. Wh
 are processed by ICU, only those parts of texts that contain Chinese are passed to
 ICU for segmentation, others can be modified by other means (different morphologies, charset_table etc.)
 
-See also
-:ref:`icu_data_dir`
-
 Additional stemmers provided by
-`Snowball <http://snowball.tartarus.org/>`__ project
-`libstemmer <http://snowball.tartarus.org/dist/libstemmer_c.tgz>`__
+`Snowball <https://snowballstem.org/>`__ project
+`libstemmer <https://snowballstem.org/dist/libstemmer_c.tgz>`__
 library can be enabled at compile time using ``--with-libstemmer``
 ``configure`` option. Built-in English and Russian stemmers should be
 faster than their libstemmer counterparts, but can produce slightly
@@ -2115,9 +2112,14 @@ as follows:
 
 -  icu_chinese - apply Chinese text segmentation using ICU
 
-Additional values provided by libstemmer are in ‘libstemmer_XXX’
-format, where XXX is libstemmer algorithm codename (refer to
-``libstemmer_c/libstemmer/modules.txt`` for a complete list).
+Additional values provided by libstemmer are in ‘libstemmer_XX’ or 'libstemmer_XXX'
+format, where XX/XXX is libstemmer algorithm codename.
+
+Current list includes: arabic (ar,ara), basque (eu,eus,baq), catalan (ca,cat), danish (da,dan), dutch (nl,dut,nld), english (en,eng), 
+finnish (fi,fin), french (fr,fre,fra), german (de,ger,deu), greek (el,gre,ell), hindi (hi,hin), hungarian (hu,hun), indonesian (id,ind), 
+irish (ga,gle), italian (it,ita), lithuanian (lt,lit), nepali (ne,nep), norwegian (no,nor), portuguese (pt,por), romanian (ro,rum,ron), 
+russian (ru,rus), spanish (es,esl,spa), swedish (sv,swe), tamil (ta,tam), turkish (tr,tur) (refer also to
+``libstemmer_c/libstemmer/modules.txt`` for an up-to-date complete list).
 
 Several stemmers can be specified (comma-separated). They will be
 applied to incoming words in the order they are listed, and the

+ 51 - 49
docs/getting-started/docker.rst

@@ -12,7 +12,7 @@ The Manticore Search container  doesn't have a persistent storage and in case th
 
 For persistence, there are 3 folders that can be mounted locally:
 
-* /etc/sphinxsearch - location of sphinx.conf 
+* /etc/manticoresearch - location of manticore.conf 
 * /var/lib/manticore/data - used for index files
 * /var/lib/manticore/log -  used for log files
 
@@ -20,9 +20,9 @@ The run command becomes:
 
 .. code-block:: bash
    
-   $ docker run --name manticore -v ~/manticore/etc/:/etc/sphinxsearch/ -v ~/manticore/data/:/var/lib/manticore/data -v ~/manticore/logs/:/var/lib/manticore/log -p 9306:9306 -d manticoresearch/manticore
+   $ docker run --name manticore -v ~/manticore/etc/:/etc/manticoresearch/ -v ~/manticore/data/:/var/lib/manticore/data -v ~/manticore/logs/:/var/lib/manticore/log -p 9306:9306 -d manticoresearch/manticore
    
-In `~/manticore/` you need to create the `etc/` , `data/` and `logs/` folders, as well as add a valid   `sphinx.conf <https://github.com/manticoresoftware/docker/blob/master/sphinx.conf>`__   in `~/manticore/etc/`.  
+In `~/manticore/` you need to create the `etc/` , `data/` and `logs/` folders, as well as add a valid   `manticore.conf <https://github.com/manticoresoftware/docker/blob/master/manticore.conf>`__   in `~/manticore/etc/`.  
 
 Running queries
 ~~~~~~~~~~~~~~~
@@ -53,14 +53,14 @@ Now let's look at our RT index:
 .. code-block:: mysql
 
    mysql> DESCRIBE testrt;
-   +---------+--------+
-   | Field   | Type   |
-   +---------+--------+
-   | id      | bigint |
-   | title   | field  |
-   | content | field  |
-   | gid     | uint   |
-   +---------+--------+
+   +----------+--------+------------+
+   | Field    | Type   | Properties |
+   +----------+--------+------------+
+   | id       | bigint |            |
+   | title    | field  | stored     |
+   | content  | field  | stored     |
+   | gid      | uint   |            |
+   +----------+--------+------------+
    4 rows in set (0.00 sec)
 
 As the RT indexes start empty, let's add some data into it first   
@@ -91,14 +91,14 @@ Fulltext searches are done with the special clause MATCH, which is the main work
 .. code-block:: mysql
 
    mysql> SELECT * FROM testrt WHERE MATCH('list of laptops');
-   +------+------+
-   | id   | gid  |
-   +------+------+
-   |    1 |   10 |
-   |    2 |   10 |
-   |    3 |   20 |
-   |    5 |   30 |
-   +------+------+
+   +------+------+-------------------------------------+---------------------------+
+   | id   | gid  | title                               | content                   |
+   +------+------+-------------------------------------+---------------------------+
+   |    1 |   10 | List of HP business laptops         | Elitebook Probook         |
+   |    2 |   10 | List of Dell business laptops       | Latitude Precision Vostro |
+   |    3 |   20 | List of Dell gaming laptops         | Inspirion Alienware       |
+   |    5 |   30 | List of ASUS ultrabooks and laptops | Zenbook Vivobook          |
+   +------+------+-------------------------------------+---------------------------+
    4 rows in set (0.00 sec)
 
 
@@ -110,12 +110,12 @@ Now let's add some filtering and more ordering:
 .. code-block:: mysql
   
    mysql> SELECT *,WEIGHT() FROM testrt WHERE MATCH('list of laptops') AND gid>10  ORDER BY WEIGHT() DESC,gid DESC;
-   +------+------+----------+
-   | id   | gid  | weight() |
-   +------+------+----------+
-   |    5 |   30 |     2334 |
-   |    3 |   20 |     2334 |
-   +------+------+----------+
+   +------+------+-------------------------------------+---------------------+----------+
+   | id   | gid  | title                               | content             | weight() |
+   +------+------+-------------------------------------+---------------------+----------+
+   |    5 |   30 | List of ASUS ultrabooks and laptops | Zenbook Vivobook    |     2334 |
+   |    3 |   20 | List of Dell gaming laptops         | Inspirion Alienware |     2334 |
+   +------+------+-------------------------------------+---------------------+----------+
    2 rows in set (0.00 sec)
 
 
@@ -127,14 +127,14 @@ The search above does a simple matching, where all words need to be present. But
 .. code-block:: mysql
 
    mysql> SELECT *,WEIGHT() FROM testrt WHERE MATCH('"list of business laptops"/3');
-   +------+------+----------+
-   | id   | gid  | weight() |
-   +------+------+----------+
-   |    1 |   10 |     2397 |
-   |    2 |   10 |     2397 |
-   |    3 |   20 |     2375 |
-   |    5 |   30 |     2375 |
-   +------+------+----------+
+   +------+------+-------------------------------------+---------------------------+----------+
+   | id   | gid  | title                               | content                   | weight() |
+   +------+------+-------------------------------------+---------------------------+----------+
+   |    1 |   10 | List of HP business laptops         | Elitebook Probook         |     2397 |
+   |    2 |   10 | List of Dell business laptops       | Latitude Precision Vostro |     2397 |
+   |    3 |   20 | List of Dell gaming laptops         | Inspirion Alienware       |     2375 |
+   |    5 |   30 | List of ASUS ultrabooks and laptops | Zenbook Vivobook          |     2375 |
+   +------+------+-------------------------------------+---------------------------+----------+
    4 rows in set (0.00 sec)
    
    
@@ -166,7 +166,7 @@ We also added a `SHOW META  <http://docs.manticoresearch.com/latest/html/sphinxq
 SHOW META returns information about previous executed query, that is number of found records (in total_found), execution time (in time) and statistics about the keywords of the search.
 
 
-To create a new RT index, you need to define it in the sphinx.conf. A simple definition looks like:
+To create a new RT index, you need to define it in the manticore.conf. A simple definition looks like:
 
 .. code-block:: none
 
@@ -179,6 +179,7 @@ To create a new RT index, you need to define it in the sphinx.conf. A simple def
          rt_attr_uint = attr2
    }
 
+Remember that rt_fields are only indexed and not stored by default. If you want their values back in the results, you need to add 'stored_fields = title'.
 To get the index online you need to either restart the daemon or send a HUP signal to it.
 
 Using plain indexes
@@ -186,7 +187,7 @@ Using plain indexes
 
 Unlike RT, a plain also requires configuring a source for it. In our example we are using a MySQL source.
 
-Add in your sphinx.conf:
+Add in your manticore.conf:
 
 .. code-block:: none
    
@@ -215,6 +216,7 @@ Add in your sphinx.conf:
 
         source                  = src1
         path                    = /var/lib/manticore/data/test1
+		stored_fields 			= title, content
         min_word_len            = 1
 
    }
@@ -269,7 +271,7 @@ Once we have this setup, we can run the indexing process:
 .. code-block:: none
 
    $ docker exec -it manticore indexer  test1  --rotate
-   using config file '/etc/sphinxsearch/sphinx.conf'...
+   using config file '/etc/sphinxsearch/manticore.conf'...
    indexing index 'test1'...
    collected 4 docs, 0.0 MB
    sorted 0.0 Mhits, 100.0% done
@@ -293,14 +295,14 @@ Index is created and is ready to be used:
    3 rows in set (0.00 sec)
    
    mysql> SELECT * FROM test1;
-   +------+----------+------------+
-   | id   | group_id | date_added |
-   +------+----------+------------+
-   |    1 |        1 | 1507904567 |
-   |    2 |        1 | 1507904567 |
-   |    3 |        2 | 1507904567 |
-   |    4 |        2 | 1507904567 |
-   +------+----------+------------+
+   +------+----------+------------+-----------------+---------------------------------------------------------------------------+
+   | id   | group_id | date_added | title           | content                                                                   |
+   +------+----------+------------+-----------------+---------------------------------------------------------------------------+
+   |    1 |        1 | 1497982018 | test one        | this is my test document number one. also checking search within phrases. |
+   |    2 |        1 | 1497982018 | test two        | this is my test document number two                                       |
+   |    3 |        2 | 1497982018 | another doc     | this is another group                                                     |
+   |    4 |        2 | 1497982018 | doc number four | this is to test groups                                                    |
+   +------+----------+------------+-----------------+---------------------------------------------------------------------------+
    4 rows in set (0.00 sec)
    
 A quick test of a search which should match 2 terms, but not match another one:
@@ -308,9 +310,9 @@ A quick test of a search which should match 2 terms, but not match another one:
 .. code-block:: mysql
    
    mysql> SELECT * FROM test1 WHERE MATCH('test document -one');
-   +------+----------+------------+-------+
-   | id   | group_id | date_added | tag   |
-   +------+----------+------------+-------+
-   |    2 |        1 | 1519040667 | 2,4,6 |
-   +------+----------+------------+-------+
+   +------+----------+------------+----------+-------------------------------------+
+   | id   | group_id | date_added | title    | content                             |
+   +------+----------+------------+----------+-------------------------------------+
+   |    2 |        1 | 1497982018 | test two | this is my test document number two |
+   +------+----------+------------+----------+-------------------------------------+
    1 row in set (0.00 sec)

+ 3 - 45
docs/getting-started/indexes.rst

@@ -110,11 +110,12 @@ An example of Real-Time index configuration:
   index realtime {
     type           = rt
 	path           = /path/to/realtime
-    rt_field       = title
-    rt_field       = description
+	rt_field       = title
+	rt_field       = description
 	rt_attr_uint   = category_id
 	rt_attr_string = title
 	rt_attr_json   = metadata
+	stored_fields  = description
     ...
    }
    
@@ -167,46 +168,3 @@ Now we added mirrors, each shard is found on 2 servers. By default, the master (
 The mode used for picking mirrors can be set with ha_strategy. In addition to random, another simple method is to do a round-robin selection ( ha_strategy= roundrobin).
 
 The more interesting strategies are the latency-weighted probabilities based ones. noerrors and nodeads not only that take out mirrors with issues, but also monitor the response times and do a balancing. If a mirror responds slower (for example due to some operations running on it), it will receive less requests. When the mirror recovers and provides better times, it will get more requests.
-
-
-Replication and cluster
-~~~~~~~~~~~~~~~~~~~~~~~
-
-To use replication define one :ref:`listen <listen>` port for SphinxAPI protocol and one :ref:`listen <listen>` for
-replication address and port range in the config. Define :ref:`data_dir <data_dir>` folder for incoming indexes.
-
-.. code-block::  none
-
-  searchd {
-    listen   = 9312
-    listen   = 192.168.1.101:9360-9370:replication
-    data_dir = /var/lib/manticore/
-    ...
-   }
-
-Create a cluster (via SphinxQL) at the daemon that has local indexes that need to be replicated 
-
-.. code-block:: sql
-
-    CREATE CLUSTER posts
-	
-Add these local indexes to cluster
-
-.. code-block:: sql
-
-    ALTER CLUSTER posts ADD pq_title
-    ALTER CLUSTER posts ADD pq_clicks
-	
-All other nodes that want replica of cluster's indexes should join cluster as
-
-.. code-block:: sql
-
-    JOIN CLUSTER posts AT '192.168.1.101:9312'
-
-When running queries prepend the index name with the cluster name (``posts:``).
-
-.. code-block:: sql
-
-    INSERT INTO posts:pq_title VALUES ( 3, 'test me' )
-
-Now all such queries that modify indexes in the cluster are replicated to all nodes in the cluster.

+ 54 - 51
docs/getting-started/official-packages.rst

@@ -25,7 +25,7 @@ or
 
 depending on the distribution used.
 
-At this point you can start using Manticore Search. The configuration file is located at ``/etc/sphinx/sphinx.conf`` (RHEL/CentOS) or ``/etc/sphinxsearch/sphinx.conf`` (Debian/Ubuntu).  The default configuration comes with an empty RT index ready to be used and a sample plain index and interfaces SphinxQL on port 9306 and native API on port 9312.
+At this point you can start using Manticore Search. The configuration file is located at ``/etc/manticoresearch/manticore.conf``.  The default configuration comes with an empty RT index ready to be used and a sample plain index and interfaces SphinxQL on port 9306 and native API on port 9312.
 
 You can also compile Manticore Search from `sources <https://github.com/manticoresoftware/manticore>`__. `Compilation <http://docs.manticoresearch.com/latest/html/installation.html#compiling-manticore-from-source>`__ is easy and uses cmake and you can also create packages for your operating system. 
 
@@ -59,14 +59,14 @@ Now let's look at our RT index:
 .. code-block:: mysql
 
    mysql> DESCRIBE testrt;
-   +---------+--------+
-   | Field   | Type   |
-   +---------+--------+
-   | id      | bigint |
-   | title   | field  |
-   | content | field  |
-   | gid     | uint   |
-   +---------+--------+
+   +----------+--------+------------+
+   | Field    | Type   | Properties |
+   +----------+--------+------------+
+   | id       | bigint |            |
+   | title    | field  | stored     |
+   | content  | field  | stored     |
+   | gid      | uint   |            |
+   +----------+--------+------------+
    4 rows in set (0.00 sec)
 
 As the RT indexes start empty, let's add some data into it first   
@@ -97,14 +97,14 @@ Fulltext searches are done with the special clause MATCH, which is the main work
 .. code-block:: mysql
 
    mysql>  SELECT * FROM testrt WHERE MATCH('list of laptops');
-   +------+------+
-   | id   | gid  |
-   +------+------+
-   |    1 |   10 |
-   |    2 |   10 |
-   |    3 |   20 |
-   |    5 |   30 |
-   +------+------+
+   +------+------+-------------------------------------+---------------------------+
+   | id   | gid  | title                               | content                   |
+   +------+------+-------------------------------------+---------------------------+
+   |    1 |   10 | List of HP business laptops         | Elitebook Probook         |
+   |    2 |   10 | List of Dell business laptops       | Latitude Precision Vostro |
+   |    3 |   20 | List of Dell gaming laptops         | Inspirion Alienware       |
+   |    5 |   30 | List of ASUS ultrabooks and laptops | Zenbook Vivobook          |
+   +------+------+-------------------------------------+---------------------------+
    4 rows in set (0.00 sec)
 
 
@@ -116,15 +116,16 @@ Now let's add some filtering and more ordering:
 .. code-block:: mysql
   
    mysql>  SELECT *,WEIGHT() FROM testrt WHERE MATCH('list of laptops') AND gid>10  ORDER BY WEIGHT() DESC,gid DESC;
-   +------+------+----------+
-   | id   | gid  | weight() |
-   +------+------+----------+
-   |    5 |   30 |     2334 |
-   |    3 |   20 |     2334 |
-   +------+------+----------+
+   +------+------+-------------------------------------+---------------------+----------+
+   | id   | gid  | title                               | content             | weight() |
+   +------+------+-------------------------------------+---------------------+----------+
+   |    5 |   30 | List of ASUS ultrabooks and laptops | Zenbook Vivobook    |     2334 |
+   |    3 |   20 | List of Dell gaming laptops         | Inspirion Alienware |     2334 |
+   +------+------+-------------------------------------+---------------------+----------+
    2 rows in set (0.00 sec)
 
 
+
 The WEIGHT() function returns the calculated matching score. If no ordering specified, the result is sorted descending by the score provided by WEIGHT().
 In this example we order first by weight and then by an integer attribute.
 
@@ -133,15 +134,16 @@ The search above does a simple matching, where all words need to be present. But
 .. code-block:: mysql
 
    mysql> SELECT *,WEIGHT() FROM testrt WHERE MATCH('"list of business laptops"/3');
-   +------+------+----------+
-   | id   | gid  | weight() |
-   +------+------+----------+
-   |    1 |   10 |     2397 |
-   |    2 |   10 |     2397 |
-   |    3 |   20 |     2375 |
-   |    5 |   30 |     2375 |
-   +------+------+----------+
+   +------+------+-------------------------------------+---------------------------+----------+
+   | id   | gid  | title                               | content                   | weight() |
+   +------+------+-------------------------------------+---------------------------+----------+
+   |    1 |   10 | List of HP business laptops         | Elitebook Probook         |     2397 |
+   |    2 |   10 | List of Dell business laptops       | Latitude Precision Vostro |     2397 |
+   |    3 |   20 | List of Dell gaming laptops         | Inspirion Alienware       |     2375 |
+   |    5 |   30 | List of ASUS ultrabooks and laptops | Zenbook Vivobook          |     2375 |
+   +------+------+-------------------------------------+---------------------------+----------+
    4 rows in set (0.00 sec)
+
    
    
    mysql> SHOW META;
@@ -172,7 +174,7 @@ We also added a `SHOW META  <http://docs.manticoresearch.com/latest/html/sphinxq
 SHOW META returns information about previous executed query, that is number of found records (in total_found), execution time (in time) and statistics about the keywords of the search.
 
 
-To create a new RT index, you need to define it in the sphinx.conf. A simple definition looks like:
+To create a new RT index, you need to define it in the manticore.conf. A simple definition looks like:
 
 .. code-block:: none
 
@@ -192,7 +194,7 @@ Using plain indexes
 ~~~~~~~~~~~~~~~~~~~
 
 Unlike RT, the plain index requires setting up the source and run the indexing process which gathers the data.
-For this we need to edit the sphinx.conf configuration file. The initial configuration comes with a sample plain index along with a source.
+For this we need to edit the manticore.conf configuration file. The initial configuration comes with a sample plain index along with a source.
 For simplicity we use a MySQL source.
 
 First, the database credentials need to be adjusted in the source configuration:
@@ -249,14 +251,13 @@ In our example group_id and date_added are attributes:
       sql_attr_timestamp      = date_added
 
 
-If we want to also store the texts or enable some features (for example wildcarding), we have to edit the index configuration:
+If we want to also  enable some features (for example wildcarding), we have to edit the index configuration:
 
 .. code-block:: none
 
       index test1
 	  {
 	  ...
-	      stored_fields           = title
           min_infix_len           = 3
 	  ...
 
@@ -266,7 +267,7 @@ Once we have this setup, we can run the indexing process:
 .. code-block:: none
 
    $ sudo -u manticore  indexer test1  --rotate
-   using config file '/etc/sphinxsearch/sphinx.conf'...
+   using config file '/etc/sphinxsearch/manticore.conf'...
    indexing index 'test1'...
    collected 4 docs, 0.0 MB
    sorted 0.0 Mhits, 100.0% done
@@ -290,26 +291,28 @@ Index is created and is ready to be used:
    3 rows in set (0.00 sec)
    
    mysql> SELECT * FROM test1;
-   +------+----------+------------+
-   | id   | group_id | date_added |
-   +------+----------+------------+
-   |    1 |        1 | 1507904567 |
-   |    2 |        1 | 1507904567 |
-   |    3 |        2 | 1507904567 |
-   |    4 |        2 | 1507904567 |
-   +------+----------+------------+
+   +------+----------+------------+-----------------+---------------------------------------------------------------------------+
+   | id   | group_id | date_added | title           | content                                                                   |
+   +------+----------+------------+-----------------+---------------------------------------------------------------------------+
+   |    1 |        1 | 1497982018 | test one        | this is my test document number one. also checking search within phrases. |
+   |    2 |        1 | 1497982018 | test two        | this is my test document number two                                       |
+   |    3 |        2 | 1497982018 | another doc     | this is another group                                                     |
+   |    4 |        2 | 1497982018 | doc number four | this is to test groups                                                    |
+   +------+----------+------------+-----------------+---------------------------------------------------------------------------+
    4 rows in set (0.00 sec)
+
    
 A quick test of a search which should match 2 terms, but not match another one:
 
 .. code-block:: mysql
    
-   mysql> SELECT * FROM test1 WHERE MATCH('test document -one');
-   +------+----------+------------+-------+
-   | id   | group_id | date_added | tag   |
-   +------+----------+------------+-------+
-   |    2 |        1 | 1519040667 | 2,4,6 |
-   +------+----------+------------+-------+
+   mysql>  SELECT * FROM test1 WHERE MATCH('test document -one');
+   +------+----------+------------+----------+-------------------------------------+
+   | id   | group_id | date_added | title    | content                             |
+   +------+----------+------------+----------+-------------------------------------+
+   |    2 |        1 | 1497982018 | test two | this is my test document number two |
+   +------+----------+------------+----------+-------------------------------------+
    1 row in set (0.00 sec)
 
-   
+
+   

+ 1 - 2
docs/httpapi_reference.rst

@@ -82,8 +82,7 @@ will be passed inside without any substitutions/url decoding.
 This endpoint expects request body with queries defined as JSON document. Responds with JSON documents containing result and/or information about executed query.
 
 .. warning::
-   Please note that this endpoint is in preview stage. Some functionalities are not yet complete and syntax may suffer changes in future.
-   Read careful changelog of future updates to avoid possible breakages.
+   Please note that this endpoint may suffer changes in future as more functionality is added. Read careful changelog of future updates to avoid possible breakages.
 
 
 .. toctree::

+ 3 - 3
docs/indexing/attributes.rst

@@ -46,10 +46,10 @@ title and content, that are full-text fields) as attributes, indexing
 them, and then using API calls to setup filtering, sorting, and
 grouping. Here as an example.
 
-.. _Example sphinx.conf part:
+.. _Example manticore.conf part:
 
-Example sphinx.conf part:
-~~~~~~~~~~~~~~~~~~~~~~~~~
+Example manticore.conf part:
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 .. code-block:: none
 

+ 1 - 1
docs/indexing/delta_index_updates.rst

@@ -36,7 +36,7 @@ Example 3.3. Fully automated live updates
         max_doc_id INTEGER NOT NULL
     );
 
-    # in sphinx.conf
+    # in manticore.conf
     source main
     {
         # ...

+ 1 - 1
docs/indexing/sql_data_sources_mysql,_postgresql.rst

@@ -52,7 +52,7 @@ Example 3.1. Ranged query usage example
 .. code-block:: ini
 
 
-    # in sphinx.conf
+    # in manticore.conf
 
     sql_query_range = SELECT MIN(id),MAX(id) FROM documents
     sql_range_step = 1000

+ 36 - 39
docs/installation.rst

@@ -27,8 +27,8 @@ You can install Manticore with command:
 
 .. code-block:: bash
 
-	$ wget https://github.com/manticoresoftware/manticore/releases/download/2.4.1/manticore_2.4.1-171017-3b31a97-release-stemmer.jessie_amd64-bin.deb
-	$ sudo dpkg -i manticore_2.4.1-171017-3b31a97-release-stemmer.jessie_amd64-bin.deb
+	$ wget https://github.com/manticoresoftware/manticoresearch/releases/download/3.2.2/manticore_3.2.2-191226-afd6046-release.jessie_amd64-bin.deb
+	$ sudo dpkg -i manticore_3.2.2-191226-afd6046-release.jessie_amd64-bin.deb
 
 Manticore package depends on zlib and ssl libraries, nothing else is strictly required.
 However if you plan to use 'indexer' tool to create indexes from different sources,
@@ -38,15 +38,16 @@ To know what exactly libraries, run `indexer` tool from Manticore and look at th
 .. code-block:: bash
 
 	$ indexer
-	Manticore 2.4.1 4258276@171019 id64-beta
+	Manticore 3.2.2 62ea5ff0@191220 release
 	Copyright (c) 2001-2016, Andrew Aksyonoff
 	Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
-	Copyright (c) 2017, Manticore Software LTD (http://manticoresearch.com)
+	Copyright (c) 2017-2019, Manticore Software LTD (http://manticoresearch.com)
 
 	Built by gcc/clang v 6.3.0,
 
-	Built on Linux d2a57137d4f5 4.8.0-45-generic #48~16.04.1-Ubuntu SMP Fri Mar 24 12:46:56 UTC 2017 x86_64 GNU/Linux
-	Configured by CMake with these definitions: -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDL_UNIXODBC=1 -DUNIXODBC_LIB=libodbc.so.2 -DDL_EXPAT=1 -DEXPAT_LIB=libexpat.so.1 -DDL_MYSQL=1 -DMYSQL_LIB=libmariadbclient.so.18 -DMYSQL_CONFIG_EXECUTABLE=/usr/bin/mysql_config -DDL_PGSQL=1 -DPGSQL_LIB=libpq.so.5 -DSPLIT_SYMBOLS=ON -DUSE_BISON=ON -DUSE_FLEX=ON -DUSE_SYSLOG=1 -DWITH_EXPAT=ON -DWITH_ICONV=ON -DWITH_MYSQL=ON -DWITH_ODBC=ON -DWITH_PGSQL=ON -DWITH_RE2=ON -DWITH_STEMMER=ON -DWITH_ZLIB=ON
+	Built on Linux runner-72989761-project-3858465-concurrent-0 4.19.78-coreos #1 SMP Mon Oct 14 22:56:39 -00 2019 x86_64 GNU/Linux
+
+	Configured by CMake with these definitions: -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDISTR_BUILD=stretch -DUSE_SSL=ON -DDL_UNIXODBC=1 -DUNIXODBC_LIB=libodbc.so.2 -DDL_EXPAT=1 -DEXPAT_LIB=libexpat.so.1 -DUSE_LIBICONV=1 -DDL_MYSQL=1 -DMYSQL_LIB=libmariadbclient.so.18 -DDL_PGSQL=1 -DPGSQL_LIB=libpq.so.5 -DLOCALDATADIR=/var/data -DFULL_SHARE_DIR=/usr/share/manticore -DUSE_ICU=1 -DUSE_BISON=ON -DUSE_FLEX=ON -DUSE_SYSLOG=1 -DWITH_EXPAT=1 -DWITH_ICONV=ON -DWITH_MYSQL=1 -DWITH_ODBC=ON -DWITH_PGSQL=1 -DWITH_RE2=1 -DWITH_STEMMER=1 -DWITH_ZLIB=ON -DGALERA_SOVERSION=31 -DSYSCONFDIR=/etc/manticoresearch
 
 Here you can see mentions of `libodbc.so.2`, `libexpat.so.1`, `libmariadbclient.so.18`, and `libpq.so.5`.
 
@@ -190,8 +191,8 @@ Download RedHat RPM from Manticore website and install it:
 
 .. code-block:: bash
 
-	$ wget https://github.com/manticoresoftware/manticore/releases/download/2.4.1/manticore-2.4.1-171017-3b31a97-release-stemmer-rhel7-bin.rpm
-	$ rpm -Uhv manticore-2.4.1-171017-3b31a97-release-stemmer-rhel7-bin.rpm
+	$ wget https://github.com/manticoresoftware/manticoresearch/releases/download/3.2.2/manticore-3.2.2_191226.afd6046-1.el7.centos.x86_64.rpm
+	$ rpm -Uhv manticore-3.2.2_191226.afd6046-1.el7.centos.x86_64.rpm
 
 Starting Manticore Search
 ~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -200,13 +201,13 @@ After preparing configuration file (see :ref:`Quick tour <quick_usage_tour>`), y
 
 .. code-block:: bash
 
-	$ systemctl start searchd
+	$ systemctl start manticore
 	
 To enable Manticore at boot:
 
 .. code-block:: bash
 
-	$ systemctl enable searchd
+	$ systemctl enable manticore
 
 
 
@@ -220,10 +221,10 @@ In the following example we'll consider folder ``C:\Manticore`` where we unpack
 .. code-block:: bash
 	
 	cd C:\Manticore
-	unzip manticore-2.4.1-171017-3b31a97-release-pgsql-stemmer-x64-bin.zip
+	unzip manticore-3.2.2-191226-afd60463-release-x64-bin.zip
 
 
-The zip comes with 2 sample configurations: ``sphinx.conf.in`` and ``sphinx-min.conf.in``. The latter is a stripped-down of comments version of the first.  	
+The zip comes with 2 sample configurations: ``manticore.conf.in`` and ``manticore-min.conf.in``. The latter is a stripped-down of comments version of the first.  	
 
 The configuration contains a ``@CONFIGDIR@`` string which needs to be replaced. The ``@CONFIGDIR@`` is the root directory of ``data`` and ``log`` folders (first is used as location for indexes, second for logs).
 The zip package comes with these folders, so they will be available at the location where you unzipped the package. If you want to use a different location, the two folders must be created there.
@@ -232,7 +233,7 @@ Install the ``searchd`` system as a Windows service:
 
 .. code-block:: bat
 
-	C:\Manticore\bin> C:\Manticore\bin\searchd --install --config C:\Manticore\sphinx.conf.in --servicename Manticore
+	C:\Manticore\bin> C:\Manticore\bin\searchd --install --config C:\Manticore\manticore.conf.in --servicename Manticore
 
 
 Make sure to use the full path of the configuration file, otherwise searchd.exe will not be able to know the location of it when it's started as service.
@@ -259,31 +260,24 @@ On MacOS Manticore can be installed in 2 easy way:
 .. code-block:: bash
 	
 	$ mkdir manticore
-	$ tar -zxvf manticore-3.1.0-190716-445e806e-release-osx10.14.4-x86_64-bin.tar -C manticore
+	$ tar -zxvf manticore-3.2.2-191226-afd60463-release-osx10.14.4-x86_64-bin.tar.gz -C manticore
 	$ cd manticore
-	$ bin/searchd  -c sphinx.conf
+	$ bin/searchd  -c manticore.conf
 
-The sphinx.conf is located in the root folder.
+The manticore.conf is located in the root folder.
 	
-2. Use official brew tap
+2. Use HomeBrew package manager
 
-Add to brew the official Manticore tap and install Manticore. Bottles are available for sierra and mojave.
-  
 .. code-block:: bash
 	
-	$ brew tap  manticoresoftware/tap
 	$ brew install manticoresearch
 	
-For indexing additional dependencies that can be installed using brew are ``[email protected]``, ``libpq``, ``unixodbc``.
-	
-Start Manticore as brew service:
+Start Manticore as a brew service:
 
 .. code-block:: bash
 	
 	$ brew services start  manticoresearch
 	
-The configuration is located at ``/usr/local/etc/manticore/sphinx.conf``.
-
 	
 .. _upgrade_from_sphinx:
 
@@ -293,12 +287,15 @@ Upgrading from Sphinx Search
 Manticore Search 2.x maintains  compatibility with  Sphinx Search 2.x  and can load existing indexes created with Sphinx Search.
 In most cases, upgrading is just a matter of replacing the binaries.
 
-In case of Linux distributions, Manticore Search continues to use the usual ``/etc/sphinxsearch/sphinx.conf``, but it runs under a different user and use different folders.
+Manticore Search 3.x breaks compatibility with both Sphinx Search 2.x and Manticore Search 2.x indexes. In this case, indexes must be either remade or converted with the provided index converter tool.
+For more information check :doc:`getting-started/migrate_from_manticore2`.
+
+In case of Linux distributions, Manticore Search switched the configuration location from  ``/etc/sphinxsearch/sphinx.conf`` ``/etc/manticoresearch/manticore.conf``.
 
 Service name has changed from ``sphinx``/``sphinxsearch`` to ``manticore`` and will run under ``manticore`` user ( Spinx was using ``sphinx`` or ``sphinxsearch``). It also uses a different folder for the PID file.
 
 Default used folders are ``/var/lib/manticore``, ``/var/log/manticore``, ``/var/run/manticore``.
-You can still use existing ``sphinx.conf``, but you need to manually change the permissions on ``/var/lib/sphinxsearch`` and ``/var/log/sphinxsearch`` folders. 
+Existing file paths can still be used, but permissions should be updated for data,log, run folders.
 If you  use other folders (for data, wordforms files etc.) the ownership must be also switched to ``manticore`` user.
 The ``pid_file`` location should be changed to match the manticore.service  to ``/var/run/manticore/searchd.pid``. 
 
@@ -351,12 +348,12 @@ Please note that any indexed data or configuration change made is lost if the co
 Mounting points 
 ~~~~~~~~~~~~~~~
 
-The configuration folder inside the image is the usual `/etc/sphinxseach`. 
+The configuration folder inside the image is the usual `/etc/manticoresearch`. 
 Index files are located at `/var/lib/manticore/data` and logs at `/var/log/manticore`.  For persistence, mount these points to your local folders.
 
 .. code-block:: bash
    
-   docker run --name manticore -v /path/to/config/:/etc/sphinxsearch/ -v /path/to/data/:/var/lib/manticore/data -v /path/to/logs/:/var/log/manticore -p 9306:9306 -d manticoresearch/manticore
+   docker run --name manticore -v /path/to/config/:/etc/manticoresearch/ -v /path/to/data/:/var/lib/manticore/data -v /path/to/logs/:/var/log/manticore -p 9306:9306 -d manticoresearch/manticore
    
 
    
@@ -401,7 +398,7 @@ General building options
 
 For compiling latest version of Manticore, recommended is checkout the latest code from the github repositiory.
 Alternative, for compiling a certain version, you can either checked that version from github or use it's respective source tarball.
-In last case avoid to use automatic tarballs from github (named there as 'Source code'), but use provided files as **manticore-2.4.1-171017-3b31a97-release.tar.gz**.
+In last case avoid to use automatic tarballs from github (named there as 'Source code'), but use provided files as **manticore-3.2.2-191226-afd6046-release.tar.gz**.
 When building from git clone you need packages **git**, **flex**, **bison**. When building from tarball they are not necessary. This requirement
 may be essential to build on Windows.
 
@@ -411,8 +408,8 @@ may be essential to build on Windows.
 
 .. code-block:: bash
 
-   $ wget https://github.com/manticoresoftware/manticore/releases/download/2.4.1/manticore-2.4.1-171017-3b31a97-release.tar.gz
-   $ tar zcvf manticore-2.4.1-171017-3b31a97-release.tar.gz
+   $ wget https://github.com/manticoresoftware/manticoresearch/releases/download/3.2.2/manticore-3.2.2-191226-afd6046-release.tar.gz
+   $ tar zcvf manticore-3.2.2-191226-afd6046-release.tar.gz
 
 Next step is to configure the building with cmake. Available list of configuration options:
 
@@ -426,7 +423,7 @@ Next step is to configure the building with cmake. Available list of configurati
 	* libstemmer_c folder in the source directory
 	* common system path. Please note that in this case, the linking is dynamic and libstemmer should be available system-wide on the installed systems
 	* libstemmer_c.tgz in  ``LIBS_BUNDLE`` folder.
-	* download from snowball project website. This is done by cmake and no additional tool is required
+	* download from snowball project website (https://snowballstem.org/dist/libstemmer_c.tgz). This is done by cmake and no additional tool is required.
 	* NOTE: if you have libstemmer in the system, but still want to use static version, say, to build a binary for a system without such lib, provide ``WITH_STEMMER_FORCE_STATIC=1`` in advance.
 	
 * ``WITH_RE2`` (bool) - specifies if the build should include the RE2 library. The library can be taken from the following locations:
@@ -486,7 +483,7 @@ or if we use sources from tarball:
 
 .. code-block:: bash
 
-   $ cmake3 -D WITH_MYSQL=1 -DWITH_RE2=1 ../manticore-2.4.1-171017-3b31a97-release
+   $ cmake3 -D WITH_MYSQL=1 -DWITH_RE2=1 ../manticore-3.2.2-191226-afd6046-release
 
 To simply compile:
 
@@ -647,13 +644,13 @@ The sample config uses a ``test`` with no password for connecting to MySQL. Adju
 
 .. code-block:: bash
 
-	$ sudo -u manticore indexer -c /etc/sphinxsearch/sphinx.conf test1 --rotate
-	Manticore 2.3.3 9b7033e@170806 master...origin/master-id64-dev
+	$ sudo -u manticore indexer -c /etc/sphinxsearch/manticore.conf test1 --rotate
+	Manticore 3.2.2 62ea5ff0@191220 release
 	Copyright (c) 2001-2016, Andrew Aksyonoff
 	Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
-	Copyright (c) 2017, Manticore Software LTD (http://manticoresearch.com)
-
-	using config file '/etc/sphinxsearch/sphinx.conf'...
+	Copyright (c) 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+	
+	using config file '/etc/sphinxsearch/manticore.conf'...
 	indexing index 'test1'...
 	collected 4 docs, 0.0 MB
 	sorted 0.0 Mhits, 100.0% done

+ 1 - 1
docs/mysql_storage_engine_sphinxse.rst

@@ -189,7 +189,7 @@ ignored so you can use arbitrary ones.
 Additional columns must be either ``INTEGER``, ``TIMESTAMP``,
 ``BIGINT``, ``VARCHAR``, or ``FLOAT``. They will be bound to attributes
 provided in Manticore result set by name, so their names must match
-attribute names specified in ``sphinx.conf``. If there's no such
+attribute names specified in ``manticore.conf``. If there's no such
 attribute name in Manticore search results, column will have ``NULL``
 values.
 

+ 34 - 35
docs/real-time_indexes.rst

@@ -13,22 +13,20 @@ Full SphinxQL reference is available in  :doc:`sphinxql_reference`.
 RT indexes overview
 -------------------
 
-RT indexes should be declared in ``sphinx.conf``, just as every other
+RT indexes should be declared in ``manticore.conf``, just as every other
 index type. Notable differences from the regular, disk-based indexes are
 that a) data sources are not required and ignored, and b) you should
 explicitly enumerate all the text fields, not just attributes. Here's an
 example:
 
-Example 4.1. RT index declaration
-                                 
 
 .. code-block:: bash
 
 
     index rt
     {
-        type = rt
-        path = /usr/local/sphinx/data/rt
+        type = testrt
+        path = /var/lib/manticore/data/testrt
         rt_field = title
         rt_field = content
         rt_attr_uint = gid
@@ -48,46 +46,44 @@ is an example session with the sample index above:
 
     Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
 
-    mysql> INSERT INTO rt VALUES ( 1, 'first record', 'test one', 123 );
+    mysql> INSERT INTO testrt VALUES ( 1, 'first record', 'test one', 123 );
     Query OK, 1 row affected (0.05 sec)
 
-    mysql> INSERT INTO rt VALUES ( 2, 'second record', 'test two', 234 );
+    mysql> INSERT INTO testrt VALUES ( 2, 'second record', 'test two', 234 );
     Query OK, 1 row affected (0.00 sec)
 
-    mysql> SELECT * FROM rt;
-    +------+--------+------+
-    | id   | weight | gid  |
-    +------+--------+------+
-    |    1 |      1 |  123 |
-    |    2 |      1 |  234 |
-    +------+--------+------+
-    2 rows in set (0.02 sec)
-
-    mysql> SELECT * FROM rt WHERE MATCH('test');
-    +------+--------+------+
-    | id   | weight | gid  |
-    +------+--------+------+
-    |    1 |   1643 |  123 |
-    |    2 |   1643 |  234 |
-    +------+--------+------+
-    2 rows in set (0.01 sec)
-
-    mysql> SELECT * FROM rt WHERE MATCH('@title test');
-    Empty set (0.00 sec)
+    mysql> SELECT * FROM testrt;
+    +------+------+---------------+----------+
+    | id   | gid  | title         | content  |
+    +------+------+---------------+----------+
+    |    1 |  123 | first record  | test one |
+    |    2 |  234 | second record | test two |
+    +------+------+---------------+----------+
+    2 rows in set (0.00 sec)
+
+
+    mysql> SELECT * FROM testrt WHERE MATCH('first one');
+    +------+------+--------------+----------+
+    | id   | gid  | title        | content  |
+    +------+------+--------------+----------+
+    |    1 |  123 | first record | test one |
+    +------+------+--------------+----------+
+    1 row in set (0.00 sec)
 
 Both partial and batch INSERT syntaxes are supported, ie. you can
 specify a subset of columns, and insert several rows at a time.
 Deletions are also possible using DELETE statement; the only currently
 supported syntax is DELETE FROM <index> WHERE id=<id>. REPLACE is also
 supported, enabling you to implement updates.
+Autoincrement values on the ID primary attribute is supported.
 
 .. code-block:: mysql
 
 
-    mysql> INSERT INTO rt ( id, title ) VALUES ( 3, 'third row' ), ( 4, 'fourth entry' );
+    mysql> INSERT INTO testrt ( id, title ) VALUES ( 3, 'third row' ), ( 4, 'fourth entry' );
     Query OK, 2 rows affected (0.01 sec)
 
-    mysql> SELECT * FROM rt;
+    mysql> SELECT * FROM testrt;
     +------+--------+------+
     | id   | weight | gid  |
     +------+--------+------+
@@ -98,10 +94,10 @@ supported, enabling you to implement updates.
     +------+--------+------+
     4 rows in set (0.00 sec)
 
-    mysql> DELETE FROM rt WHERE id=2;
+    mysql> DELETE FROM testrt WHERE id=2;
     Query OK, 0 rows affected (0.00 sec)
 
-    mysql> SELECT * FROM rt WHERE MATCH('test');
+    mysql> SELECT * FROM testrt WHERE MATCH('test');
     +------+--------+------+
     | id   | weight | gid  |
     +------+--------+------+
@@ -109,13 +105,13 @@ supported, enabling you to implement updates.
     +------+--------+------+
     1 row in set (0.00 sec)
 
-    mysql> INSERT INTO rt VALUES ( 1, 'first record on steroids', 'test one', 123 );
+    mysql> INSERT INTO testrt (title,content,gid) VALUES ('a new record','test three',100);
     ERROR 1064 (42000): duplicate id '1'
 
-    mysql> REPLACE INTO rt VALUES ( 1, 'first record on steroids', 'test one', 123 );
+    mysql> REPLACE INTO testrt VALUES ( 1, 'first record changed', 'test one', 123 );
     Query OK, 1 row affected (0.01 sec)
 
-    mysql> SELECT * FROM rt WHERE MATCH('steroids');
+    mysql> SELECT * FROM testrt WHERE MATCH('steroids');
     +------+--------+------+
     | id   | weight | gid  |
     +------+--------+------+
@@ -155,6 +151,9 @@ known usage quirks. Those quirks are listed in this section.
 -  Multiple INSERTs grouped in a single transaction perform better than
    equivalent single-row transactions and are recommended for batch
    loading of data.
+   
+- Autoincrement ID values don't start from zero, values are generated using an algorithm that makes
+  sure in case of Real-Time indexes replicated in a cluster don't generate same IDs
 
    
 RT index internals
@@ -202,7 +201,7 @@ index purging that would improve the performance may be performed with
 Data in RAM chunk gets saved to disk on clean daemon shutdown, and then
 loaded back on startup. However, on daemon or server crash, updates from
 RAM chunk might be lost. To prevent that, binary logging of transactions
-can be used; see `the section called :ref:`binary_logging` for details.
+can be used; see the section called :ref:`binary_logging` for details.
 
 Full-text changes in RT index are transactional. They are stored in a
 per-thread accumulator until COMMIT, then applied at once. Bigger

+ 45 - 0
docs/releasenotes.rst

@@ -1,6 +1,51 @@
 Release notes
 =============
 
+Version 3.2.2, 19 December 2019
+-------------------------------
+
+Features
+~~~~~~~~
+
+* Autoincrement ID for RT indexes
+* Highlight support for docstore via new HIGHLIGHT() function, available also in HTTP API
+* SNIPPET() can use special function QUERY() which returns current MATCH query
+* new field_separator option for highlighting functions.
+
+Improvements and changes
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+* lazy fetch of stored fields for remote nodes (can significantly increase performance)
+* strings and expressions don't break anymore multi-query and FACET optimizations
+* RHEL/CentOS 8 build now uses mysql libclient from mariadb-connector-c-devel
+* ICU data file is now shipped with the packages, icu_data_dir removed 
+* systemd service files include 'Restart=on-failure' policy
+* indextool can now check real-time indexes online
+* default conf is now /etc/manticoresearch/manticore.conf
+* service on RHEL/CentOS renamed to 'manticore' from 'searchd'
+
+Bugfixes
+~~~~~~~~
+
+* `6ae474c7894a6bee222d5b18e59a44fdbf57843a <https://github.com/manticoresoftware/manticoresearch/commit/6ae474c7894a6bee222d5b18e59a44fdbf57843a>`__ fix crash on SELECT query over HTTP interface
+* `59577513a49eac5a4a3c5e2cb38394d3246b5d35 <https://github.com/manticoresoftware/manticoresearch/commit/59577513a49eac5a4a3c5e2cb38394d3246b5d35>`__ fix RT index saves disk chunks but does not mark some documents deleted
+* `e861f0fca0e88924450695d4e9d6acff7a36558a <https://github.com/manticoresoftware/manticoresearch/commit/e861f0fca0e88924450695d4e9d6acff7a36558a>`__ fix crash on search of multi index or multi queries with dist_threads 
+* `440991fc977b8479800b45cdbc862eeb1ba5d965 <https://github.com/manticoresoftware/manticoresearch/commit/440991fc977b8479800b45cdbc862eeb1ba5d965>`__ fix crash on infix generation for long terms with wide utf8 codepoints
+* `5fd599b48bba527c023e6aa0b262dca51ffb8a1c <https://github.com/manticoresoftware/manticoresearch/commit/5fd599b48bba527c023e6aa0b262dca51ffb8a1c>`__ fix race at adding socket to IOCP
+* `cf10d7d3589f77adfaefbe52a51777bc9c67cf99 <https://github.com/manticoresoftware/manticoresearch/commit/cf10d7d3589f77adfaefbe52a51777bc9c67cf99>`__ fix issue of bool queries vs json select list
+* `996de77f4c3ec103d965e28c36098fd07dba50c4 <https://github.com/manticoresoftware/manticoresearch/commit/996de77f4c3ec103d965e28c36098fd07dba50c4>`__ fix indextool check to report wrong skiplist offset, check of doc2row lookup
+* `6e3fc9e88941c9427410f9d0adeebb7dd09a900f <https://github.com/manticoresoftware/manticoresearch/commit/6e3fc9e88941c9427410f9d0adeebb7dd09a900f>`__ fix indexer produces bad index with negative skiplist offset on large data
+* `faed3220b423a96401982bf47117edf1f62c584e <https://github.com/manticoresoftware/manticoresearch/commit/faed3220b423a96401982bf47117edf1f62c584e>`__ fix JSON converts only numeric to string and JSON string to numeric conversion at expressions
+* `533197200249d648ebcbdaca5d605861ee566348 <https://github.com/manticoresoftware/manticoresearch/commit/533197200249d648ebcbdaca5d605861ee566348>`__ fix indextool exit with error code in case multiple commands set at command line
+* `795520ac351d22e4497ebaf6c249bf25081842b6 <https://github.com/manticoresoftware/manticoresearch/commit/795520ac351d22e4497ebaf6c249bf25081842b6>`__ fix #275 binlog invalid state on error no space left on disk
+* `2284da5e3ff77bf7be4038a4d950c0580e4159c8 <https://github.com/manticoresoftware/manticoresearch/commit/2284da5e3ff77bf7be4038a4d950c0580e4159c8>`__ fix #279 crash on IN filter to JSON attribute
+* `ce2e4b4765111a7d331ffc256911f12770a8942d <https://github.com/manticoresoftware/manticoresearch/commit/ce2e4b4765111a7d331ffc256911f12770a8942d>`__ fix #281 wrong pipe closing call
+* `535589ba8a37baf5c6056afb5ff969fd70476feb <https://github.com/manticoresoftware/manticoresearch/commit/535589ba8a37baf5c6056afb5ff969fd70476feb>`__ fix daemon hung at CALL PQ with recursive JSON attribute encoded as string
+* `a5fc8a36e1644ee051632408ab8b53e79aeb9ff4 <https://github.com/manticoresoftware/manticoresearch/commit/a5fc8a36e1644ee051632408ab8b53e79aeb9ff4>`__ fix advancing beyond the end of the doclist in multiand node
+* `a3628617ef4ee89a811d4ba2c4a04cbbc298c1b5 <https://github.com/manticoresoftware/manticoresearch/commit/a3628617ef4ee89a811d4ba2c4a04cbbc298c1b5>`__ fix retrieving of thread public info
+* `f8d2d7bbbb90af3d2ee97424f97b05927f09d42b <https://github.com/manticoresoftware/manticoresearch/commit/f8d2d7bbbb90af3d2ee97424f97b05927f09d42b>`__ fix docstore cache locks
+
+
 Version 3.2.0, 17 October 2019
 ------------------------------
 

+ 0 - 4
docs/replication.rst

@@ -4,10 +4,6 @@
 Replication
 ===========
 
-.. warning::
-  Please note that this feature is in preview stage. Some functionality may be not yet complete and may suffer changes.
-  Read carefully changelogs of future updates to avoid possible breakages.
-
 Manticore search daemon can replicate a write transaction (``INSERT``, ``REPLACE``, ``DELETE``, ``TRUNCATE``, ``UPDATE``, etc)
 in an index to other nodes in the cluster. Currently percolate and rt indexes are supported.
 Only Linux packages and builds support replication, Windows and MacOS packages do not support replication.

+ 1 - 1
docs/reporting_bugs.rst

@@ -103,7 +103,7 @@ Uploading your data
 -------------------
 
 To fix your bug developers often need to reproduce it on their machines.
-To do this they need your sphinx.conf, index files, binlog (if present),
+To do this they need your manticore.conf, index files, binlog (if present),
 sometimes data to index (like SQL tables or XMLpipe2 data files) and
 queries.
 

+ 2 - 2
docs/sphinxql_reference/alter_syntax.rst

@@ -26,7 +26,7 @@ fail if an index has only one attribute.
 
 ALTER can also reconfigure an existing RT index, so that new
 tokenization, morphology, and other text processing settings from
-sphinx.conf take effect on the newly INSERT-ed rows, while retaining the
+manticore.conf take effect on the newly INSERT-ed rows, while retaining the
 existing rows as they were. Internally, it forcibly saves the current
 RAM chunk as a new disk chunk, and adjusts the index header, so that the
 new rows are tokenized using the new rules. Note that as the queries are
@@ -83,4 +83,4 @@ ALTER can be used to change killlist_target settings of an index:
 
     ALTER TABLE delta KILLLIST_TARGET='main'
 
-Kill-list is applied to indexes listed in ``killlist_target`` immediately.
+Kill-list is applied to indexes listed in ``killlist_target`` immediately.

+ 1 - 1
docs/sphinxql_reference/show_index_settings_syntax.rst

@@ -8,7 +8,7 @@ SHOW INDEX SETTINGS syntax
 
     SHOW INDEX index_name[.N | CHUNK N] SETTINGS
 
-Displays per-index settings in a ``sphinx.conf`` compliant file format,
+Displays per-index settings in a ``manticore.conf`` compliant file format,
 similar to the :ref:`–dumpconfig <indextool_command_reference>`
 option of the indextool. The report provides a breakdown of all the
 index settings, including tokenizer and dictionary options. You may also

+ 1 - 1
libstemmer_c/README

@@ -1,3 +1,3 @@
 Dummy file for automake.
 Should be overwritten after libstemmer_c.tgz is properly extracted.
-The latest should be available at http://snowball.tartarus.org/dist/libstemmer_c.tgz
+The latest should be available at https://snowballstem.org/dist/libstemmer_c.tgz

+ 2 - 0
sphinx-min.conf.in → manticore-min.conf.in

@@ -24,6 +24,7 @@ source src1
 index test1
 {
 	source			= src1
+	stored_fields = title,content
 	path			= @CONFDIR@/data/test1
 }
 
@@ -37,6 +38,7 @@ index testrt
 
 	rt_field		= title
 	rt_field		= content
+	stored_fields = title,content
 	rt_attr_uint		= gid
 }
 

+ 6 - 8
sphinx.conf.in → manticore.conf.in

@@ -349,7 +349,9 @@ index test1
 	# optional, default is 'keywords'
 	dict			= keywords
 
-
+	# store content of fields
+	stored_fields = title,content
+	
 	# a list of morphology preprocessors to apply
 	# optional, default is empty
 	#
@@ -744,7 +746,9 @@ index testrt
 	# multi-value, mandatory
 	rt_field		= title
 	rt_field		= content
-
+	
+	# store content of fields
+	stored_fields = title,content
 	# unsigned integer attribute declaration
 	# multi-value (an arbitrary number of attributes is allowed), optional
 	# declares an unsigned 32-bit attribute
@@ -1108,12 +1112,6 @@ common
 	# json_autoconv_keynames = lowercase
 
 
-	# ICU data directory
-	# optional, defaut is /usr/local/share (see ./configure --datadir)
-	#
-	# icu_data_dir = /usr/local/share/sphinx/icu
-
-
 	# trusted plugin directory
 	# optional, default is empty (disable UDFs)
 	#

+ 9 - 1
misc/ctest/gltest.cmake

@@ -54,6 +54,8 @@ endif()
 set ( CONFIG_OPTIONS "WITH_ODBC=1;WITH_RE2=1;WITH_STEMMER=1;WITH_PGSQL=${WITH_PGSQL};WITH_EXPAT=1;USE_SSL=1" )
 set ( CTEST_BINARY_DIRECTORY "build" )
 
+LIST ( APPEND CONFIG_OPTIONS "CMAKE_INSTALL_DATADIR=${CTEST_SOURCE_DIRECTORY}/build/installdir" )
+
 if ( CTEST_BUILD_CONFIGURATION STREQUAL Debug )
 	# configure coverage
 	set ( WITH_COVERAGE TRUE )
@@ -114,8 +116,14 @@ ctest_configure ()
 if ( WIN_TEST_CI )
 	ctest_build ()
 else ( WIN_TEST_CI )
-	ctest_build ( FLAGS -j5 )
+	ctest_build ( FLAGS "-j5 install" )
 endif ()
+
+# create installdir for ICU data
+file ( MAKE_DIRECTORY "build/installdir" )
+file ( MAKE_DIRECTORY "build/installdir/icu" )
+file ( COPY "build/icu/source/data/in/" DESTINATION "build/installdir/icu/" FILES_MATCHING PATTERN "*.dat" )
+
 if ( COPY_DLL )
 	MESSAGE ( STATUS "copy dll from ${COPY_DLL} to build/src/Debug" )
 	file ( COPY "${COPY_DLL}/" DESTINATION "build/src/Debug/" FILES_MATCHING PATTERN "*.dll" )

+ 7 - 1
misc/ctest/justbuild.cmake

@@ -6,6 +6,7 @@ set ( CTEST_BUILD_CONFIGURATION "$ENV{CTEST_BUILD_CONFIGURATION}" )
 set ( CTEST_CMAKE_GENERATOR "$ENV{CTEST_CMAKE_GENERATOR}" )
 set ( LIBS_BUNDLE "$ENV{LIBS_BUNDLE}" )
 set ( USE_GALERA "$ENV{USE_GALERA}")
+set ( WITH_ICU "$ENV{WITH_ICU}")
 set ( OPENSSL_ROOT_DIR "$ENV{OPENSSL_ROOT_DIR}" )
 set_property ( GLOBAL PROPERTY Label P$ENV{CI_PIPELINE_ID} J$ENV{CI_JOB_ID} )
 
@@ -16,10 +17,15 @@ if ( NOT USE_GALERA )
 	set ( USE_GALERA 0 )
 endif()
 
+if ( NOT WITH_ICU )
+	set ( WITH_ICU 0 )
+endif()
+
 # common test options
 set ( CONFIG_OPTIONS "WITH_ODBC=1;WITH_RE2=1;WITH_STEMMER=1;WITH_PGSQL=1;WITH_EXPAT=1;DISABLE_TESTING=1" )
 LIST ( APPEND CONFIG_OPTIONS "LIBS_BUNDLE=${LIBS_BUNDLE}" )
-LIST(APPEND CONFIG_OPTIONS "USE_GALERA=${USE_GALERA}")
+LIST ( APPEND CONFIG_OPTIONS "USE_GALERA=${USE_GALERA}" )
+LIST ( APPEND CONFIG_OPTIONS "WITH_ICU=${WITH_ICU}" )
 
 if ( NOT CTEST_SOURCE_DIRECTORY )
 	set ( CTEST_SOURCE_DIRECTORY "${CI_PROJECT_DIR}")

+ 0 - 6
mysqlse/ha_sphinx.h

@@ -1,6 +1,3 @@
-//
-// $Id$
-//
 
 #ifdef USE_PRAGMA_INTERFACE
 #pragma interface // gcc class implementation
@@ -169,6 +166,3 @@ int sphinx_showfunc_time ( THD *, SHOW_VAR *, char * );
 int sphinx_showfunc_word_count ( THD *, SHOW_VAR *, char * );
 int sphinx_showfunc_words ( THD *, SHOW_VAR *, char * );
 
-//
-// $Id$
-//

+ 0 - 8
mysqlse/snippets_udf.cc

@@ -1,7 +1,3 @@
-//
-// $Id$
-//
-
 //
 // Copyright (c) 2001-2016, Andrew Aksyonoff
 // Copyright (c) 2008-2016, Sphinx Technologies Inc
@@ -812,7 +808,3 @@ void sphinx_snippets_deinit ( UDF_INIT * pUDF )
 	CSphSnippets * pOpts = (CSphSnippets *)pUDF->ptr;
 	SafeDelete ( pOpts );
 }
-
-//
-// $Id$
-//

+ 1 - 1
src/accumulator.h

@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 // All rights reserved
 //
 // This program is free software; you can redistribute it and/or modify

+ 1 - 5
src/attribute.cpp

@@ -1,9 +1,5 @@
 //
-// $Id$
-//
-
-//
-// Copyright (c) 2017-2018, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 // All rights reserved
 //
 // This program is free software; you can redistribute it and/or modify

+ 1 - 8
src/attribute.h

@@ -1,9 +1,5 @@
 //
-// $Id$
-//
-
-//
-// Copyright (c) 2017-2018, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 // All rights reserved
 //
 // This program is free software; you can redistribute it and/or modify
@@ -138,6 +134,3 @@ inline DocID_t sphGetDocID ( const CSphRowitem * pData )
 
 #endif
 
-//
-// $Id$
-//

+ 1 - 1
src/charsets/globalaliases.h.in

@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2019, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2019-2020, Manticore Software LTD (http://manticoresearch.com)
 // All rights reserved
 //
 // This program is free software; you can redistribute it and/or modify

+ 1 - 5
src/docstore.cpp

@@ -1,9 +1,5 @@
 //
-// $Id$
-//
-
-//
-// Copyright (c) 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 // All rights reserved
 //
 // This program is free software; you can redistribute it and/or modify

+ 1 - 8
src/docstore.h

@@ -1,9 +1,5 @@
 //
-// $Id$
-//
-
-//
-// Copyright (c) 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 // All rights reserved
 //
 // This program is free software; you can redistribute it and/or modify
@@ -108,6 +104,3 @@ bool				CheckDocstore ( CSphAutoreader & tReader, DebugCheckError_c & tReporter
 
 #endif
 
-//
-// $Id$
-//

+ 1 - 1
src/global_idf.cpp

@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 // Copyright (c) 2001-2016, Andrew Aksyonoff
 // Copyright (c) 2008-2016, Sphinx Technologies Inc
 // All rights reserved

+ 1 - 1
src/global_idf.h

@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 // Copyright (c) 2001-2016, Andrew Aksyonoff
 // Copyright (c) 2008-2016, Sphinx Technologies Inc
 // All rights reserved

+ 1 - 1
src/gtests/gtests_filter.cpp

@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 // Copyright (c) 2001-2016, Andrew Aksyonoff
 // Copyright (c) 2008-2016, Sphinx Technologies Inc
 // All rights reserved

+ 1 - 1
src/gtests/gtests_functions.cpp

@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 // Copyright (c) 2001-2016, Andrew Aksyonoff
 // Copyright (c) 2008-2016, Sphinx Technologies Inc
 // All rights reserved

+ 1 - 1
src/gtests/gtests_globalstate.cpp

@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 // Copyright (c) 2001-2016, Andrew Aksyonoff
 // Copyright (c) 2008-2016, Sphinx Technologies Inc
 // All rights reserved

+ 1 - 1
src/gtests/gtests_json.cpp

@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 // All rights reserved
 //
 // This program is free software; you can redistribute it and/or modify

+ 1 - 1
src/gtests/gtests_pqstuff.cpp

@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 // All rights reserved
 //
 // This program is free software; you can redistribute it and/or modify

+ 1 - 1
src/gtests/gtests_rtstuff.cpp

@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 // Copyright (c) 2001-2016, Andrew Aksyonoff
 // Copyright (c) 2008-2016, Sphinx Technologies Inc
 // All rights reserved

+ 44 - 44
src/icu.cpp

@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 // Copyright (c) 2001-2016, Andrew Aksyonoff
 // Copyright (c) 2008-2016, Sphinx Technologies Inc
 // All rights reserved
@@ -34,24 +34,45 @@
 #include <unicode/udata.h>
 #include <unicode/ustring.h>
 
-#ifndef ICU_LIB
-#define ICU_LIB "no_icu_configured"
-#endif
+#if USE_WINDOWS
+	#include <shlwapi.h>
 
-#if DL_ICU
-#include "ldicu.inl"
-#else
-#define imp_createWordInstance icu::BreakIterator::createWordInstance
-#define imp_u_errorName u_errorName
-#define imp_u_setDataDirectory u_setDataDirectory
-#define imp_utext_openUTF8 utext_openUTF8
-#define imp_utext_close utext_close
-#define imp_getChinese icu::Locale::getChinese
-#define InitDynamicIcu() (true)
+	#pragma comment(linker, "/defaultlib:Shlwapi.lib")
+	#pragma message("Automatically linking with Shlwapi.lib")
 #endif
 
 extern CSphVector<CharsetAlias_t> g_dCharsetAliases;
 
+static CSphString g_sICUDir = ICU_DATA_DIR;
+
+//////////////////////////////////////////////////////////////////////////
+
+static bool g_bICUInitialized = false;
+
+static void ConfigureICU()
+{
+	if ( g_bICUInitialized )
+		return;
+
+#if USE_WINDOWS
+	if ( PathIsRelative(ICU_DATA_DIR) )
+	{
+		HMODULE hModule = GetModuleHandle(NULL);
+		CHAR szPath[MAX_PATH];
+		GetModuleFileName ( hModule, szPath, MAX_PATH );
+		PathRemoveFileSpec(szPath);
+
+		g_sICUDir.SetSprintf ( "%s\\%s", szPath, ICU_DATA_DIR );
+	}
+#endif
+
+	u_setDataDirectory ( g_sICUDir.cstr() );
+
+	g_bICUInitialized = true;
+}
+
+//////////////////////////////////////////////////////////////////////////
+
 class ICUPreprocessor_c
 {
 public:
@@ -93,21 +114,17 @@ ICUPreprocessor_c::~ICUPreprocessor_c()
 
 bool ICUPreprocessor_c::Init ( CSphString & sError )
 {
-	assert ( !m_pBreakIterator );
+	ConfigureICU();
 
-	if_const ( !InitDynamicIcu ())
-	{
-		sError.SetSprintf ( "ICU: failed to load icu library (tried "  ICU_LIB ")" );
-		return false;
-	}
+	assert ( !m_pBreakIterator );
 
 	UErrorCode tStatus = U_ZERO_ERROR;
-	m_pBreakIterator = imp_createWordInstance ( imp_getChinese(), tStatus );
+	m_pBreakIterator = icu::BreakIterator::createWordInstance ( icu::Locale::getChinese(), tStatus );
 	if ( U_FAILURE(tStatus) )
 	{
-		sError.SetSprintf( "Unable to initialize ICU break iterator: %s", imp_u_errorName(tStatus) );
+		sError.SetSprintf( "Unable to initialize ICU break iterator: %s", u_errorName(tStatus) );
 		if ( tStatus==U_MISSING_RESOURCE_ERROR )
-			sError.SetSprintf ( "%s. Make sure ICU data file is accessible (icu_data_dir might be missing in config)", sError.cstr() );
+			sError.SetSprintf ( "%s. Make sure ICU data file is accessible (using '%s' folder)", sError.cstr(), g_sICUDir.cstr() );
 
 		return false;			
 	}
@@ -227,16 +244,16 @@ void ICUPreprocessor_c::ProcessBufferICU ( const BYTE * pBuffer, int iLength )
 	assert ( m_pBreakIterator );
 	UErrorCode tStatus = U_ZERO_ERROR;
 	UText * pUText = nullptr;
-	pUText = imp_utext_openUTF8 ( pUText, (const char*)pBuffer, iLength, &tStatus );
+	pUText = utext_openUTF8 ( pUText, (const char*)pBuffer, iLength, &tStatus );
 	if ( U_FAILURE(tStatus) )
-		sphWarning ( "Error processing buffer (ICU): %s", imp_u_errorName(tStatus) );
+		sphWarning ( "Error processing buffer (ICU): %s", u_errorName(tStatus) );
 
 	assert ( pUText );
 	m_pBreakIterator->setText ( pUText, tStatus );
 	if ( U_FAILURE(tStatus) )
-		sphWarning ( "Error processing buffer (ICU): %s", imp_u_errorName(tStatus) );
+		sphWarning ( "Error processing buffer (ICU): %s", u_errorName(tStatus) );
 
-	imp_utext_close ( pUText );
+	utext_close ( pUText );
 
 	m_pBuffer = pBuffer;
 	m_iPrevBoundary = m_iBoundaryIndex = m_pBreakIterator->first();
@@ -447,19 +464,6 @@ bool sphSpawnFilterICU ( FieldFilterRefPtr_c & pFieldFilter, const CSphIndexSett
 	return true;
 }
 
-
-void sphConfigureICU ( CSphConfigSection & hCommon )
-{
-	if_const ( !InitDynamicIcu ())
-	{
-		sphWarning ( "ICU: failed to load icu library (tried "  ICU_LIB ")" );
-		return;
-	}
-
-	CSphString sData = hCommon.GetStr ( "icu_data_dir" );
-	imp_u_setDataDirectory ( sData.cstr() );
-}
-
 #else
 
 
@@ -494,8 +498,4 @@ bool sphSpawnFilterICU ( FieldFilterRefPtr_c &, const CSphIndexSettings &, const
 	return true;
 }
 
-void sphConfigureICU ( CSphConfigSection & )
-{
-}
-
 #endif

+ 1 - 2
src/icu.h

@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 // Copyright (c) 2001-2016, Andrew Aksyonoff
 // Copyright (c) 2008-2016, Sphinx Technologies Inc
 // All rights reserved
@@ -19,6 +19,5 @@
 bool sphCheckConfigICU ( CSphIndexSettings & tSettings, CSphString & sError );
 bool sphCheckTokenizerICU ( CSphIndexSettings & tSettings, const CSphTokenizerSettings & tTokSettings, CSphString & sError );
 bool sphSpawnFilterICU ( FieldFilterRefPtr_c & pFieldFilter, const CSphIndexSettings & m_tSettings, const CSphTokenizerSettings & tTokSettings, const char * szIndex, CSphString & sError );
-void sphConfigureICU ( CSphConfigSection & hCommon );
 
 #endif // _icu_

+ 3 - 10
src/index_converter.cpp

@@ -1,9 +1,5 @@
 //
-// $Id$
-//
-
-//
-// Copyright (c) 2018, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2018-2020, Manticore Software LTD (http://manticoresearch.com)
 // All rights reserved
 //
 // This program is free software; you can redistribute it and/or modify
@@ -2450,9 +2446,9 @@ static void ShowHelp ()
 		"index_converter, a tool to convert index files from 2.X to 3.0 format\n"
 		"\n"
 		"Usage:\n"
-		"index_converter --config sphinx.conf --index test\n"
+		"index_converter --config manticore.conf --index test\n"
 		"index_converter --path path_to_index_files --killlist-target main_idx:id\n"
-		"index_converter --config sphinx.conf --all --output-dir converted\n"
+		"index_converter --config manticore.conf --all --output-dir converted\n"
 		"\n"
 		"Options are:\n"
 		"-c, --config <file>\t\tread configuration from specified file\n"
@@ -2699,6 +2695,3 @@ int main ( int argc, char ** argv )
 	return 0;
 }
 
-//
-// $Id$
-//

+ 80 - 0
src/indexcheck.cpp

@@ -314,6 +314,7 @@ private:
 	void	CheckDocidLookup();
 	void	CheckDocids();
 	void	CheckDocstore();
+	void	CheckSchema();
 	
 	bool		ReadHeader ( CSphString & sError );
 	CSphString	GetFilename ( ESphExt eExt ) const;
@@ -443,6 +444,7 @@ void DiskIndexChecker_c::Setup ( int64_t iNumRows, int64_t iDocinfoIndex, int64_
 
 void DiskIndexChecker_c::Check()
 {
+	CheckSchema();
 	CheckDictionary();
 	CheckDocs();
 	CheckAttributes();
@@ -1335,4 +1337,82 @@ CSphString DiskIndexChecker_c::GetFilename ( ESphExt eExt ) const
 DiskIndexChecker_i * CreateDiskIndexChecker ( CSphIndex & tIndex, DebugCheckError_c & tReporter )
 {
 	return new DiskIndexChecker_c ( tIndex, tReporter );
+}
+
+struct ColumnNameCmp_fn
+{
+	inline bool IsLess ( const CSphColumnInfo & tColA, const CSphColumnInfo & tColB ) const
+	{
+		return ( strcasecmp ( tColA.m_sName.cstr(), tColB.m_sName.cstr() )<0 );
+	}
+};
+
+static CSphString DumpAttr ( const CSphColumnInfo & tCol )
+{
+	CSphString sRes;
+	if ( tCol.m_tLocator.IsBlobAttr() )
+		sRes.SetSprintf ( "%s at blob@%d", sphTypeName ( tCol.m_eAttrType ), tCol.m_tLocator.m_iBlobAttrId );
+	else
+		sRes.SetSprintf ( "%s at %d@%d", sphTypeName ( tCol.m_eAttrType ), tCol.m_tLocator.m_iBitCount, tCol.m_tLocator.m_iBitOffset );
+
+	return sRes;
+}
+
+template <typename T>
+void DebugCheckSchema_T ( const ISphSchema & tSchema, T & tReporter )
+{
+	// check duplicated names
+	CSphVector<CSphColumnInfo> dAttrs;
+	dAttrs.Reserve ( tSchema.GetAttrsCount() );
+	for ( int iAttr=0; iAttr<tSchema.GetAttrsCount(); iAttr++ )
+		dAttrs.Add ( tSchema.GetAttr ( iAttr ) );
+
+	dAttrs.Sort ( ColumnNameCmp_fn() );
+	
+	for ( int iAttr=1; iAttr<dAttrs.GetLength(); iAttr++ )
+	{
+		const CSphColumnInfo & tPrev = dAttrs[iAttr-1];
+		const CSphColumnInfo & tCur = dAttrs[iAttr];
+		if ( strcasecmp ( tPrev.m_sName.cstr(), tCur.m_sName.cstr() )==0 )
+			tReporter.Fail ( "duplicate attributes name %s for columns: %s, %s", tCur.m_sName.cstr(), DumpAttr ( tPrev ).cstr(), DumpAttr ( tCur ).cstr() );
+	}
+}
+
+void DiskIndexChecker_c::CheckSchema()
+{
+	m_tReporter.Msg ( "checking schema..." );
+	DebugCheckSchema_T ( m_tSchema, m_tReporter );
+}
+
+struct StringReporter_t
+{
+	StringBuilder_c m_sErrors;
+
+	void Fail ( const char * szFmt, ... )
+	{
+		va_list ap;
+		va_start ( ap, szFmt );
+		m_sErrors.vAppendf ( szFmt, ap );
+		va_end ( ap );
+	}
+};
+
+bool DebugCheckSchema ( const ISphSchema & tSchema, CSphString & sError )
+{
+	StringReporter_t tRes;
+	DebugCheckSchema_T ( tSchema, tRes );
+	
+	if ( !tRes.m_sErrors.IsEmpty() )
+	{
+		sError = tRes.m_sErrors.cstr();
+		return false;
+	} else
+	{
+		return true;
+	}
+}
+
+void DebugCheckSchema ( const ISphSchema & tSchema, DebugCheckError_c & tReporter )
+{
+	DebugCheckSchema_T ( tSchema, tReporter );
 }

+ 4 - 0
src/indexcheck.h

@@ -75,4 +75,8 @@ public:
 
 DiskIndexChecker_i * CreateDiskIndexChecker ( CSphIndex & tIndex, DebugCheckError_c & tReporter );
 
+void DebugCheckSchema ( const ISphSchema & tSchema, DebugCheckError_c & tReporter );
+bool DebugCheckSchema ( const ISphSchema & tSchema, CSphString & sError );
+bool SchemaConfigureCheckAttribute ( const CSphSchema & tSchema, const CSphColumnInfo & tCol, CSphString & sError );
+
 #endif // _indexcheck_

+ 5 - 5
src/indexer.cpp

@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 // Copyright (c) 2001-2016, Andrew Aksyonoff
 // Copyright (c) 2008-2016, Sphinx Technologies Inc
 // All rights reserved
@@ -658,7 +658,7 @@ bool SqlParamsConfigure ( CSphSourceParams_SQL & tParams, const CSphConfigSectio
 		for ( int j = i + 1; j < tParams.m_dAttrs.GetLength(); j++ )
 		{
 			const CSphString & sName = tParams.m_dAttrs[i].m_sName;
-			if ( sName==tParams.m_dAttrs[j].m_sName )
+			if ( strcasecmp ( sName.cstr(), tParams.m_dAttrs[j].m_sName.cstr() )==0 )
 			{
 				fprintf ( stdout, "ERROR: duplicate attribute name: %s\n", sName.cstr() );
 				return false;
@@ -1606,7 +1606,7 @@ static void ShowHelp ()
 		"-h, --help\t\tdisplay this help message\n"
 		"-v\t\t\tdisplay version information\n"
 		"--config <file>\t\tread configuration from specified file\n"
-		"\t\t\t(default is sphinx.conf)\n"
+		"\t\t\t(default is manticore.conf)\n"
 		"--all\t\t\treindex all configured indexes\n"
 		"--quiet\t\t\tbe quiet, only print errors\n"
 		"--verbose [debug|debugv|debugvv]\n"
@@ -1633,8 +1633,8 @@ static void ShowHelp ()
 		"--keep-attrs\t\tretain attributes from the old index\n"
 		"\n"
 		"Examples:\n"
-		"indexer --quiet myidx1\treindex 'myidx1' defined in 'sphinx.conf'\n"
-		"indexer --all\t\treindex all indexes defined in 'sphinx.conf'\n" );
+		"indexer --quiet myidx1\treindex 'myidx1' defined in 'manticore.conf'\n"
+		"indexer --all\t\treindex all indexes defined in 'manticore.conf'\n" );
 }
 
 

+ 1 - 1
src/indextool.cpp

@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 // Copyright (c) 2001-2016, Andrew Aksyonoff
 // Copyright (c) 2008-2016, Sphinx Technologies Inc
 // All rights reserved

+ 1 - 1
src/literal.h.in

@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2019, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2019-2020, Manticore Software LTD (http://manticoresearch.com)
 // All rights reserved
 //
 // This program is free software; you can redistribute it and/or modify

+ 1 - 1
src/replication/wsrep_api_stub.h

@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2019, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2019-2020, Manticore Software LTD (http://manticoresearch.com)
 //
 // This is pure stub header, it does nothing and just make it possible to make build
 // under windows. All other files in this folder also useless on win.

+ 13 - 12
src/searchd.cpp

@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 // Copyright (c) 2001-2016, Andrew Aksyonoff
 // Copyright (c) 2008-2016, Sphinx Technologies Inc
 // All rights reserved
@@ -4772,6 +4772,7 @@ bool MinimizeAggrResult ( AggrResult_t & tRes, const CSphQuery & tQuery, bool bH
 		ProcessPostlimitArgs_t tArgs ( tQuery, bMaster );
 		ComputePostlimit ( tArgs, tRes );
 	}
+
 	if ( bMaster && !dRemotes.IsEmpty() )
 	{
 		CSphScopedProfile tProf ( pProfiler, SPH_QSTATE_EVAL_POST );
@@ -5416,6 +5417,7 @@ void SearchHandler_c::RunLocalSearchesParallel()
 			tRes.m_iTotalMatches += pSorter->GetTotalCount();
 
 			tRes.m_pBlobPool = tRaw.m_pBlobPool;
+			tRes.m_pDocstore = tRaw.m_pDocstore;
 			MergeWordStats ( tRes, tRaw.m_hWordStats, &m_dFailuresSet[iQuery], sLocal, sParentIndex );
 
 			tRes.m_bHasPrediction |= tRaw.m_bHasPrediction;
@@ -9030,8 +9032,7 @@ void HandleCommandExcerpt ( CachedOutputBuffer_c & tOut, int iVer, InputBuffer_c
 		}
 	}
 
-	q.m_bHasBeforePassageMacro = SnippetTransformPassageMacros ( q.m_sBeforeMatch, q.m_sBeforeMatchPassage );
-	q.m_bHasAfterPassageMacro = SnippetTransformPassageMacros ( q.m_sAfterMatch, q.m_sAfterMatchPassage );
+	q.Setup();
 
 	CSphString sPassageBoundaryMode;
 	if ( iVer>=0x103 )
@@ -12687,8 +12688,7 @@ void HandleMysqlCallSnippets ( SqlRowBuffer_c & tOut, SqlStmt_t & tStmt, ThdDesc
 		return;
 	}
 
-	q.m_bHasBeforePassageMacro = SnippetTransformPassageMacros ( q.m_sBeforeMatch, q.m_sBeforeMatchPassage );
-	q.m_bHasAfterPassageMacro = SnippetTransformPassageMacros ( q.m_sAfterMatch, q.m_sAfterMatchPassage );
+	q.Setup();
 
 	CSphVector<ExcerptQueryChained_t> dQueries;
 	if ( tStmt.m_dInsertValues[0].m_iType==TOK_QUOTED_STRING )
@@ -15711,6 +15711,7 @@ static void AddPlainIndexStatus ( SqlRowBuffer_c & tOut, const ServedIndex_c * p
 		if ( ServedDesc_t::IsMutable ( pLocked ) )
 		{
 			tOut.DataTuplet ( "ram_chunk", tStatus.m_iRamChunkSize );
+			tOut.DataTuplet ( "ram_chunks_count", tStatus.m_iNumRamChunks );
 			tOut.DataTuplet ( "disk_chunks", tStatus.m_iNumChunks );
 			tOut.DataTuplet ( "mem_limit", tStatus.m_iMemLimit );
 			tOut.DataTuplet ( "ram_bytes_retired", tStatus.m_iRamRetired );
@@ -19225,7 +19226,7 @@ void ShowHelp ()
 		"-h, --help\t\tdisplay this help message\n"
 		"-v\t\t\tdisplay version information\n"
 		"-c, --config <file>\tread configuration from specified file\n"
-		"\t\t\t(default is sphinx.conf)\n"
+		"\t\t\t(default is manticore.conf)\n"
 		"--stop\t\t\tsend SIGTERM to currently running searchd\n"
 		"--stopwait\t\tsend SIGTERM and wait until actual exit\n"
 		"--status\t\tget ant print status variables\n"
@@ -19261,9 +19262,9 @@ void ShowHelp ()
 		"--coredump\t\tsave core dump file on crash\n"
 		"\n"
 		"Examples:\n"
-		"searchd --config /usr/local/sphinx/etc/sphinx.conf\n"
+		"searchd --config /usr/local/sphinx/etc/manticore.conf\n"
 #if USE_WINDOWS
-		"searchd --install --config c:\\sphinx\\sphinx.conf\n"
+		"searchd --install --config c:\\sphinx\\manticore.conf\n"
 #endif
 		);
 }
@@ -22737,12 +22738,12 @@ int WINAPI ServiceMain ( int argc, char **argv ) REQUIRES (!MainThread)
 	while ( !g_sConfigFile.cstr() )
 	{
 #ifdef SYSCONFDIR
-		g_sConfigFile = SYSCONFDIR "/sphinx.conf";
+		g_sConfigFile = SYSCONFDIR "/manticore.conf";
 		if ( sphIsReadable ( g_sConfigFile.cstr () ) )
 			break;
 #endif
 
-		g_sConfigFile = "./sphinx.conf";
+		g_sConfigFile = "./manticore.conf";
 		if ( sphIsReadable ( g_sConfigFile.cstr () ) )
 			break;
 
@@ -22753,9 +22754,9 @@ int WINAPI ServiceMain ( int argc, char **argv ) REQUIRES (!MainThread)
 	if ( !g_sConfigFile.cstr () )
 		sphFatal ( "no readable config file (looked in "
 #ifdef SYSCONFDIR
-			SYSCONFDIR "/sphinx.conf, "
+			SYSCONFDIR "/manticore.conf, "
 #endif
-			"./sphinx.conf)." );
+			"./manticore.conf)." );
 
 	CSphVector<char> dConfig;
 	CheckConfigChanges ( dConfig );

+ 1 - 1
src/searchdaemon.cpp

@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 // Copyright (c) 2001-2016, Andrew Aksyonoff
 // Copyright (c) 2008-2016, Sphinx Technologies Inc
 // All rights reserved

+ 3 - 6
src/searchdexpr.cpp

@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 // Copyright (c) 2001-2016, Andrew Aksyonoff
 // Copyright (c) 2008-2016, Sphinx Technologies Inc
 // All rights reserved
@@ -263,11 +263,7 @@ Expr_Snippet_c::Expr_Snippet_c ( ISphExpr * pArglist, CSphIndex * pIndex, CSphQu
 			return;
 	}
 
-	m_tSnippetQuery.m_bHasBeforePassageMacro =
-			SnippetTransformPassageMacros ( m_tSnippetQuery.m_sBeforeMatch, m_tSnippetQuery.m_sBeforeMatchPassage );
-	m_tSnippetQuery.m_bHasAfterPassageMacro =
-			SnippetTransformPassageMacros ( m_tSnippetQuery.m_sAfterMatch, m_tSnippetQuery.m_sAfterMatchPassage );
-
+	m_tSnippetQuery.Setup();
 	if ( !m_pSnippetBuilder->Setup ( m_pIndex, m_tSnippetQuery, sError ) )
 		return;
 
@@ -431,6 +427,7 @@ Expr_Highlight_c::Expr_Highlight_c ( ISphExpr * pArglist, CSphIndex * pIndex, CS
 	else
 		MarkAllFields();
 
+	m_tSnippetQuery.Setup();
 	if ( !m_pSnippetBuilder->Setup ( m_pIndex, m_tSnippetQuery, sError ) )
 		return;
 }

+ 1 - 5
src/searchdfields.cpp

@@ -1,9 +1,5 @@
 //
-// $Id$
-//
-
-//
-// Copyright (c) 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 // All rights reserved
 //
 // This program is free software; you can redistribute it and/or modify

+ 6 - 5
src/searchdha.cpp

@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2017-2019, Manticore Software LTD (http://manticoresearch.com)
+// Copyright (c) 2017-2020, Manticore Software LTD (http://manticoresearch.com)
 // Copyright (c) 2001-2016, Andrew Aksyonoff
 // Copyright (c) 2008-2016, Sphinx Technologies Inc
 // All rights reserved
@@ -4224,10 +4224,11 @@ public:
 
 		sphLogDebugv ( "%p kqueue remove, ev=0x%u, sock=%d",
 				pEvent->m_tBack.pPtr, pEvent->m_uNetEvents, pEvent->m_iSock );
-		struct kevent tEv[2];
-		EV_SET( &tEv[0], pEvent->m_iSock, EVFILT_WRITE, EV_DELETE | EV_CLEAR, 0, 0, nullptr );
-		EV_SET( &tEv[1], pEvent->m_iSock, EVFILT_READ, EV_DELETE | EV_CLEAR, 0, 0, nullptr );
-		int iRes = kevent ( m_iKQ, tEv, 2, nullptr, 0, nullptr );
+		struct kevent tEv;
+		EV_SET( &tEv, pEvent->m_iSock,
+			( ( pEvent->m_uNetEvents & NetPollEvent_t::READ ) ? EVFILT_READ : EVFILT_WRITE ),
+			EV_DELETE | EV_CLEAR, 0, 0, nullptr );
+		int iRes = kevent ( m_iKQ, &tEv, 1, nullptr, 0, nullptr );
 
 		// might be already closed by worker from thread pool
 		if ( iRes==-1 )

Some files were not shown because too many files changed in this diff