How to Allow Special Characters(#,#,!,&,(,),%) as search keyword in Sphinx - sphinx

I have got struck with the implementation of allowing Special Characters(#,#,!,&,(,),%) as search keyword in Sphinx..
Please suggest me..
Below is the config file,
/* Starts */
source dbserver
{
type = mysql
sql_host = localhost
sql_user = root
sql_pass =
sql_db = mydb
#sql_sock = /var/run/mysqld/mysqld.sock
sql_port = 3306
}
searchd
{
listen = localhost:3312
# port = 9313
log = /* some searchd.log path */
query_log = /* some query.log path */
pid_file = /* some searchd.pid path */
max_matches = 10000
seamless_rotate = 0
}
source adsearch : mydbserver
{
sql_query_post = REPLACE INTO sph_tracker SELECT 1,'ad',CURRENT_TIMESTAMP;
sql_ranged_throttle = 1
sql_attr_uint = networkid
sql_attr_uint = folderid
sql_attr_uint = createdby
sql_attr_uint = status
sql_attr_timestamp = createdon
}
index index_adsearch
{
source = adsearch
path = /* some path */
morphology = stem_en
min_word_len = 0
#min_prefix_len = 5
min_infix_len = 2
enable_star = 1
preopen = 1
}
source delta_adsearch : adsearch
{
sql_query = DELETE FROM ad where status='Deleted' AND deleteflag='Y'
}
index delta_index_adsearch : index_adsearch
{
source = delta_adsearch
path = /* some path */
}
source tmplsearch : mydbserver
{
sql_query_post = REPLACE INTO sph_tracker SELECT 2,'template',CURRENT_TIMESTAMP;
sql_ranged_throttle = 1
sql_attr_uint = networkid
sql_attr_uint = industryid
sql_attr_uint = status
sql_attr_timestamp = createdon
sql_attr_timestamp = startdate
sql_attr_timestamp = enddate
sql_attr_uint = active
sql_attr_uint = primarysize
}
index index_tmplsearch
{
source = tmplsearch
path = /* some path */
morphology = stem_en
min_word_len = 0
#min_prefix_len = 5
min_infix_len = 2
enable_star = 1
preopen = 1
}
source delta_tmplsearch : tmplsearch
{
sql_query = DELETE FROM adtemplate where status='Deleted' AND deleteflag='Y'
}
index delta_index_tmplsearch : index_tmplsearch
{
source = delta_tmplsearch
path = /* some path */
}
source media_assets_search : mydbserver
{
#sql_query_post = REPLACE INTO sph_tracker SELECT 3,'media',CURRENT_TIMESTAMP;
sql_ranged_throttle = 1
sql_attr_uint = networkid
sql_attr_uint = mediatype
sql_attr_uint = mediacat
sql_attr_uint = uploadedby
sql_attr_uint = active
sql_attr_uint = industryid
sql_attr_timestamp = uploaddate
sql_attr_uint = diskstore
}
index index_media_assets_search
{
source = media_assets_search
path = /* some path */
morphology = stem_en
min_word_len = 0
#min_prefix_len = 5
min_infix_len = 2
enable_star = 1
preopen = 1
}
source delta_media_assets_search : media_assets_search
{
}
index delta_index_media_assets_search : index_media_assets_search
{
source = delta_media_assets_search
path = /* some path */
}
/* Ends */
Please have a look at this and suggest me..
Thanks,
Nagu..

You need to add them to charset_table config.
You may also want to make sure you escape the query to avoid being misinterpreted as search syntax.
While there do also read up on blend_chars

Related

TYPO3 empty body tag

I did a upgrade from 9.5 to 10.4 and i guess Typoscript is not working right. There are no errors displayed (also the log files..)
The Header is rendering right but the Body-Tag stays empty.
I'm kinda lost right now.. it's always a pleasure upgrading Typo3.
Any Idea? Are there any Typoscript Tags which are out of date?
config {
absRefPrefix = /
disableBodyTag = 1
metaCharset = utf-8
prefixLocalAnchors = all
contentObjectExceptionHandler = 0
}
# HEADER MAINNAV MENU
headermainnav = HMENU
headermainnav {
entryLevel = 0
1 = TMENU
1 {
wrap = <ul>|</ul>
NO = 1
NO {
wrapItemAndSub = <li>|</li>
}
ACT = 1
ACT {
wrapItemAndSub = <li class="active">|</li>
}
}
2 < .1
}
# LANGUAGE SELECTOR
languagemenu = COA
languagemenu {
20 = HMENU
20 {
special = language
special.value = 0,2
special.normalWhenNoLanguage = 0
wrap =
1 = TMENU
1 {
noBlur = 1
NO = 1
NO {
doNotLinkIt = 1
linkWrap = <li>|</li>
stdWrap.override = DE || EN
stdWrap {
typolink {
parameter.data = page:uid
additionalParams = &L=0 || &L=2
ATagParams = hreflang="de-DE" || hreflang="en-GB"
addQueryString = 1
addQueryString.exclude = L,id,no_cache
addQueryString.method = GET
no_cache = 0
}
}
}
ACT < .NO
ACT.linkWrap = <li class="active">|</li>
USERDEF1 < .NO
USERDEF1 {
linkWrap = <li class="text-muted">|</li>
stdWrap.typolink >
}
USERDEF2 < .ACT
USERDEF2 {
linkWrap = <li class="text-muted">|</li>
stdWrap.typolink >
}
}
}
wrap = <ul id="language_menu" class="language-menu">|</ul>
}
# FOOTER MAINNAV MENU
footermainnav = HMENU
footermainnav {
entryLevel = 0
excludeUidList = 2,3,4,5,6
1 = TMENU
1 {
wrap = <ul>|</ul>
NO = 1
NO {
wrapItemAndSub = <li>|</li>
}
ACT = 1
ACT {
wrapItemAndSub = <li class="active">|</li>
}
}
2 < .1
}
page = PAGE
page {
# set baseURL on the flow
headerData.5 = TEXT
headerData.5.data=getIndpEnv:HTTP_HOST
headerData.5.wrap = <base href="{$websiteConfig.protocol}://|/"></base>
meta {
description = page:description
viewport = width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no
X-UA-Compatible = IE=edge
X-UA-Compatible.attribute = http-equiv
}
shortcutIcon = fileadmin/t3/img/favicon.png
includeCSS {
googlefontscss = https://fonts.googleapis.com/css?family=Fira+Sans:400,400i,600,600i,800,800i|Oswald:500
googlefontscss.external = 1
file1 = fileadmin/t3/css/normalize.css
file2 = fileadmin/t3/css/grid12.css
file3 = fileadmin/t3/css/slick.min.css
file4 = fileadmin/t3/css/style.css
file5 = fileadmin/t3/custom.css
}
includeJS {
file1 = fileadmin/t3/js/jquery.min.js
}
includeJSFooter {
file2 = fileadmin/t3/js/lottie.min.js
file3 = fileadmin/t3/js/slick.min.js
file4 = fileadmin/t3/script.js
file5 = fileadmin/t3/js/custom.js
}
10 = TEMPLATE
10 {
template = FILE
template.file = fileadmin/t3/layout.html
relPathPrefix = fileadmin/t3/
workOnSubpart = DOCUMENT
substMarksSeparately = 1
marks {
COPYRIGHT = TEXT
COPYRIGHT {
data = date : U
strftime = %Y
noTrimWrap = |© | TYPO3 All Rights Reserved.|
}
BODYTAG = TEXT
BODYTAG.insertData = 1
BODYTAG.dataWrap = <body class="no-touch" data-page="{tsfe:id}">
CONTACTFORM = CONTENT
CONTACTFORM {
table = tt_content
select {
pidInList = 23
includeRecordsWithoutDefaultTranslation = 1
}
}
HEADERMAINNAV < headermainnav
LANGUAGESELECTOR < languagemenu
FOOTERMAINNAV < footermainnav
CONTENT = CONTENT
CONTENT {
table = tt_content
select {
languageField = 1
orderBy = sorting
includeRecordsWithoutDefaultTranslation = 1
}
}
NEWSBANNER = CONTENT
NEWSBANNER {
table = tt_content
select {
pidInList = 47
includeRecordsWithoutDefaultTranslation = 1
}
}
COOKIEHINTCONTENT = CONTENT
COOKIEHINTCONTENT {
table = tt_content
select {
pidInList = 14
includeRecordsWithoutDefaultTranslation = 1
}
}
IMPRINTCONTENT = CONTENT
IMPRINTCONTENT {
table = tt_content
select {
pidInList = 16
includeRecordsWithoutDefaultTranslation = 1
}
}
PRIVACYCONTENT = CONTENT
PRIVACYCONTENT {
table = tt_content
select {
pidInList = 17
includeRecordsWithoutDefaultTranslation = 1
}
}
JOBROWS = CONTENT
JOBROWS {
table = tt_content
select {
pidInList = 27
orderBy = sorting
includeRecordsWithoutDefaultTranslation = 1
}
}
DOWNLOADS_DE = CONTENT
DOWNLOADS_DE {
table = tt_content
select {
pidInList = 31
where = sys_language_uid = 0
languageField = 0
orderBy = sorting
includeRecordsWithoutDefaultTranslation = 1
}
}
DOWNLOADS_EN = CONTENT
DOWNLOADS_EN {
table = tt_content
select {
pidInList = 31
where = sys_language_uid = 2
languageField = 0
orderBy = sorting
}
}
FAQDATA = CONTENT
FAQDATA {
table = tt_content
select {
pidInList = 34
orderBy = sorting
includeRecordsWithoutDefaultTranslation = 1
}
}
}
}
}
Keep in mind that TEMPLATE, MARKERS and SUBPARTS will be removed in TYPO3 11.
the 10.template = FILE was removed in TYPO3 10.
You will have to switch to FLUID.
Read more here: https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/ContentObjects/Template/Index.html
10 = FLUIDTEMPLATE
10 {
# also dynamic with .stdWrap
templateName = TemplateName
layoutRootPaths {
# if you set <f:layout name="Whatever" /> in your template, create Whatever.html there
10 = fileadmin/t3/Layouts/
}
partialRootPaths {
10 = fileadmin/t3/Partials/
}
templateRootPaths {
# make sure you have TemplateName.html inside (whatever templateName will be)
10 = fileadmin/t3/Templates/
}
variables {
# use as {copyright} in template
copyright = TEXT
copyright{
data = date : U
strftime = %Y
noTrimWrap = |© | TYPO3 All Rights Reserved.|
}
}
}
// untested, but should be right

I want to override in typoscript CONTENT or renderObj with noting

I have a little problem, the following code works, but to not show what I do not want to display, I'm forced to put style =" display: none " with invalid HTML code, because I'm in <ul> <li> ... </ ul>. How could I not display anything at all?
40 = CONTENT
40 {
table = tt_content
select {
orderBy = sorting
pidInList.field = uid
where = {#colPos}=99 and deleted = 0 and hidden = 0
}
renderObj = COA
renderObj {
20 = TEXT
20.stdWrap.field = header
20.stdWrap.wrap = <b>|</b>
# OVERRIDE for <ul><li> ...
20.stdWrap.wrap.override = <span style="display:none">|</span>
20.stdWrap.wrap.override.if.value = 1
20.stdWrap.wrap.override.if.equals.dataWrap = {register:typeOfMenu}
30 = TEXT
30.stdWrap.field = bodytext
30.stdWrap.wrap = <i>|</i>
# OVERRIDE for <ul><li> ...
30.stdWrap.wrap.override = <span style="display:none">|</span>
30.stdWrap.wrap.override.if.value = 1
30.stdWrap.wrap.override.if.equals.dataWrap = {register:typeOfMenu}
40 = FILES
40 {
references {
table = tt_content
uid.data = field:uid
fieldName = image
}
begin = 0
maxItems = 1
renderObj = IMAGE
renderObj {
file {
import.data = file:current:originalUid // file:current:uid
#width = 232c
#height = 145c
}
required = 1
wrap = <div class="img-wrap">|</div>
}
}
# OVERRIDE for <ul><li> ...
40.stdWrap.wrap.override = <span style="display:none">|</span>
40.stdWrap.wrap.override.if.value = 1
40.stdWrap.wrap.override.if.equals.dataWrap = {register:typeOfMenu}
}//COA
}//CONTENT
In fact, I tried a lot of stuff before resigning myself to <span style =" display: none "> | </ span>, do you have a better solution?
Best regards
Did you try these propositions?
40.renderObj.40.if {
value = 1
equals.dataWrap = {register:typeOfMenu}
}
or
40.renderObj.40.stdWrap.if {
value = 1
equals.dataWrap = {register:typeOfMenu}
}
if that's not working you've to check if the register is filled with any data, you can check that just by rendering it too in 40.renderObj.50:
40.renderObj.50 = TEXT
40.renderObj.50.data = {register:typeOfMenu}
As it seems that {register:typeOfMenu} is defined outside that CONTENT and you want to render the whole block only if {register:typeOfMenu}=1 you could also note it like this:
40 = CONTENT
40 {
table = tt_content
select {
orderBy = sorting
pidInList.field = uid
where = {#colPos}=99 and deleted = 0 and hidden = 0
}
renderObj = COA
renderObj {
20 = TEXT
20.stdWrap.field = header
20.stdWrap.wrap = <b>|</b>
30 = TEXT
30.stdWrap.field = bodytext
30.stdWrap.wrap = <i>|</i>
40 = FILES
40 {
references {
table = tt_content
uid.data = field:uid
fieldName = image
}
begin = 0
maxItems = 1
renderObj = IMAGE
renderObj {
file {
import.data = file:current:originalUid // file:current:uid
#width = 232c
#height = 145c
}
required = 1
wrap = <div class="img-wrap">|</div>
}
}
}//COA
stdWrap.if {
value = 1
equals.dataWrap = {register:typeOfMenu}
}
}//CONTENT
Sorry, but I did not put all the code, there was before a COA. Now, thanks to your advice I have solved the problem. Here is the complete code:
NO {
doNotLinkIt = 1
stdWrap.cObject = COA
stdWrap.cObject {
10 = TEXT
10.wrap = <h1>|</h1>
10.field = nav_title // title
10.typolink.parameter.field = uid
# OVERRIDE for <ul><li> ...
10.wrap.override = <li class="laclasse">|
10.wrap.override.if.value = 1
10.wrap.override.if.equals.dataWrap = {register:typeOfMenu}
40 = CONTENT
40 {
table = tt_content
select {
orderBy = sorting
pidInList.field = uid
where = {#colPos}=99 and deleted = 0 and hidden = 0
}
renderObj = COA
renderObj {
20 = TEXT
20.stdWrap.field = header
20.stdWrap.wrap = <b>|</b>
30 = TEXT
30.stdWrap.field = bodytext
30.stdWrap.wrap = <i>|</i>
40 = FILES
40 {
references {
table = tt_content
uid.data = field:uid
fieldName = image
}
begin = 0
maxItems = 1
renderObj = IMAGE
renderObj {
file {
import.data = file:current:originalUid // file:current:uid
#width = 232c
#height = 145c
}
required = 1
#wrap = <div class="img-wrap">|</div>
titleText.data = page:subtitle
altText.data = page:subtitle
stdWrap.typolink.parameter.data = leveluid:0
}
}
}//COA
}//CONTENT
}//COA
# OVERRIDE for <ul><li> ...
stdWrap.cObject.40.if {
value = 1
equals.dataWrap = {register:typeOfMenu}
negate = 1
}
Thanking you,
Best regards

formhandler typo3 feuser double opt in

I have a user registration form with the extension formhandler and a user is created in the right sysfolder. But the double opt in link which is created and send via e-mail does not work. The user is still hidden. I think that the link does not include the sysfolder with the feuserdata. When I click the link I get the error message: that the authorization code is not found and maybe the authorization has already been done. But that is not true.
plugin.Tx_Formhandler.settings.predef.register {
name = Formhandler User Registration
templateFile = typo3conf/templates/main/plugins/formhandler/register.html
disableWrapInBaseClass = 1
formID = registration
formValuesPrefix = feregistration
isErrorMarker.default = error
isErrorMarker {
global = error
}
preProcessors {
1.class = PreProcessor_LoadGetPost
2.class = PreProcessor_ValidateAuthCode
2.config {
redirectPage = 1045
hiddenField = hidden
selectFields = email
additionalParams = COA
additionalParams {
10 = TEXT
10.value = &pid=1044
}
}
}
finishers {
1.class = Finisher_DB
1.config {
table = fe_users
fields {
pid.postProcessing = 1044
email.mapping = email
username.mapping = email
password.mapping = password
password.special = saltedpassword
password.special.field = password
first_name.mapping = firstname
last_name.mapping = name
address.mapping = streetno
usergroup.ifIsEmpty = 1
disable.ifIsEmpty = 1
}
}
2.class = Finisher_GenerateAuthCode
2.config {
table = fe_users
fields {
pid.postProcessing = 1044
}
selectFields = email
}
3.class = Finisher_DB
3.config {
table = fe_users
updateInsteadOfInsert = 1
fields {
fe_cruser_id.special = inserted_uid
fe_cruser_id.special.table = fe_users
}
}
4.class = Finisher_Mail
4.config {
checkBinaryCrLf = message
admin {
to_email = admin#mail.de
subject = TEXT
subject.dataWrap = Neue Registrierung: {GP:formhandler|firstname} {GP:formhandler|name}
sender_email = email
replyto_email = email
}
user {
to_email = email
to_name = name
subject = Vielen Dank für deine Registrierung
sender_email = user#mail.de
sender_name = user
replyto_email = user#mail.de
replyto_name = user
}
}
5.class = Finisher_SubmittedOK
5.config {
returns = 1
}
}
}
I tried to include the sysfolder pid as an additional parameter but the url does not get this parameter.
In your preProcessor, hiddenField should be disable. This is the name of the field you want to set to 0 if the auth code is validated. You should also ensure there actually is an hidden field in your form named disable and with value 1.

tt_news category image url

I need the url of the image from tt_news category to fill conf.tt_news.10.stdWrap.ifEmpty. Does anyone have an idea. My approach
lib.catimage = TEXT
lib.catimage {
table = tt_news_cat
select {
pidInList = 2
andWhere {
data = GPVar:tx_ttnews|cat
....????
page.headerData {
15 = RECORDS
15 {
source.data = GPvar:tx_ttnews|tt_news
tables = tt_news
conf.tt_news = COA
conf.tt_news.10 = IMG_RESOURCE
conf.tt_news.10.file {
width = 403
import = uploads/pics/
import.field = image
import.listNum = 0
}
conf.tt_news.10.stdWrap.ifEmpty < lib.catimage
wrap = <link rel="image_src" href="{$BaseUrl}|" />
}
}
I have a new approach, but do not see the error. If I take out the commented brace the path is correct but the syntax of the script is incorrect. The first part also does not work anymore. Here the modified version.
page.headerData {
15 = RECORDS
15 {
source.data = GPvar:tx_ttnews|tt_news
tables = tt_news
conf.tt_news = COA
conf.tt_news.10 = IMG_RESOURCE
conf.tt_news.10.file {
width = 403
import = uploads/pics/
import.field = image
import.listNum = 0
}
conf.tt_news.10.stdWrap.ifEmpty.cObject = CONTENT
conf.tt_news.10.stdWrap.ifEmpty.cObject {
table = tt_news_cat
select {
selectFields = image
pidInList = 2
languageField = sys_language_uid
where = deleted=0 AND hidden=0
andWhere {
data = GPvar:tx_ttnews|category
wrap = uid=|
intval = 1
}
}
#}
renderObj = TEXT
renderObj.field = image
}
wrap = <link rel="image_src" href="{$BaseUrl}|" />
}
}

objectAtIndex in NSDictionary

I am trying to create UITableView from my NSDictionary, but how can I use objectForKey? Convert to NSArray?
I need help.
My dictionary looks like:
**
{
"allow_comments" = 1;
category = 1024194;
"created_at" = "2011-11-17T01:44";
forum = 1005401;
"forum_obj" = {
"created_at" = "2011-09-03 03:04:43.514514";
description = "";
id = 1005401;
name = smartfiction;
shortname = smartfiction;
};
hidden = 0;
id = 474530565;
identifier = (
"2507 http://smartfiction.ru/?p=2507"
);
"num_comments" = 2;
slug = "thread_9714";
title = "\U041e\U0440\U0438\U0444\U043b\U0430\U043c\U043c\U0430. \U042d\U0436\U0435\U043d \U0418\U043e\U043d\U0435\U0441\U043a\U043e";
url = "http://smartfiction.ru/prose/oriflamma/";
}
2011-11-19 10:21:25.992 ARSSReader[3067:15503] id 474530565
2011-11-19 10:21:26.864 ARSSReader[3067:15503] Ответ #2: (
{
author = {
avatar = {
cache = "http://www.gravatar.com/avatar.php?gravatar_id=af6c6f08e213427ad611b00589db00f9&size=32&default=http://mediacdn.disqus.com/1321567697/images/noavatar32.png";
permalink = "http://www.gravatar.com/avatar.php?gravatar_id=af6c6f08e213427ad611b00589db00f9&size=32&default=http://mediacdn.disqus.com/1321567697/images/noavatar32.png";
};
emailHash = af6c6f08e213427ad611b00589db00f9;
isAnonymous = 1;
name = "S Shv";
profileUrl = "http://disqus.com/guest/af6c6f08e213427ad611b00589db00f9/";
url = "";
};
createdAt = "2011-11-17T22:39:36";
dislikes = 0;
forum = smartfiction;
id = 367003621;
isApproved = 1;
isDeleted = 0;
isEdited = 0;
isFlagged = 0;
isHighlighted = 0;
isJuliaFlagged = 1;
isSpam = 0;
likes = 0;
media = (
);
message = "\U043f\U043e\U0440\U0430\U0437\U0438\U043b\U043e )";
parent = "<null>";
points = 0;
"raw_message" = "\U043f\U043e\U0440\U0430\U0437\U0438\U043b\U043e )";
thread = 474530565;
},
{
author = {
avatar = {
cache = "http://www.gravatar.com/avatar.php?gravatar_id=c1c53088e04a60aab74cd1f149117e69&size=32&default=http://mediacdn.disqus.com/1321567697/images/noavatar32.png";
permalink = "http://www.gravatar.com/avatar.php?gravatar_id=c1c53088e04a60aab74cd1f149117e69&size=32&default=http://mediacdn.disqus.com/1321567697/images/noavatar32.png";
};
emailHash = c1c53088e04a60aab74cd1f149117e69;
isAnonymous = 1;
name = "3,14";
profileUrl = "http://disqus.com/guest/c1c53088e04a60aab74cd1f149117e69/";
url = "";
};
createdAt = "2011-11-17T02:52:46";
dislikes = 0;
forum = smartfiction;
id = 365544459;
isApproved = 1;
isDeleted = 0;
isEdited = 0;
isFlagged = 0;
isHighlighted = 0;
isJuliaFlagged = 1;
isSpam = 0;
likes = 1;
media = (
);
message = "\U0427\U0438\U0442\U0430\U0442\U044c \U043d\U0430 \U043d\U043e\U0447\U044c \U043f\U0440\U043e\U043a\U0440\U0430\U0441\U0442\U0438\U043d\U0430\U0442\U043e\U0440\U0430\U043c. \U0412\U043f\U0440\U043e\U0447\U0435\U043c, \U043b\U0443\U0447\U0448\U0435 \U0443\U0442\U0440\U043e\U043c.";
parent = "<null>";
points = 1;
"raw_message" = "\U0427\U0438\U0442\U0430\U0442\U044c \U043d\U0430 \U043d\U043e\U0447\U044c \U043f\U0440\U043e\U043a\U0440\U0430\U0441\U0442\U0438\U043d\U0430\U0442\U043e\U0440\U0430\U043c. \U0412\U043f\U0440\U043e\U0447\U0435\U043c, \U043b\U0443\U0447\U0448\U0435 \U0443\U0442\U0440\U043e\U043c.";
thread = 474530565;
}
)
**
It is comments from disqus.com. I want to create dictionaries for all comments and use them to create UITableView cells.
Instead of storing the comments from disqus.com in a dictionary, store each comment in an entry inside an array (it looks like each comment has a block of text you can encapsulate into an object which you can store into an array).
Dictionaries are good for associating values with keys.
Arrays are great for storing lists of objects, much like a list of comments from a disqus site.