indexing server query

I would like to group by with an indexing service query.  I keep getting syntax errors. I need to group on the Year(write) and Month(write).  I understand the date format of the write field is different so how can i convert the write format to a format the Year() function can process and can I do this anyway?

string mysearch = "select Year(write) as Yr, Month(write) as Mth, filename, Directory, HitCount from SCOPE('\"" + mypath + "\"')  GROUP BY Yr, Mth ";


3/1/2009 4:48:01 PM 819 articles. 0 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 50
Get it on Google Play
Get it on Apple App Store

You have to group by all of the fields in the select list (unless aggregets are used) plus you need to apply the same Year/Month conversion to the GROUP BY as well.  My Indexing Server is a bit rusty but below should work. 

SELECT YEAR(write) as Yr, MONTH(write) as Mth, filename, Directory, HitCount FROM SCOPE('\"" + mypath + "\"') GROUP BY YEAR(write), MONTH(write), filename, Directory, HitCount

- William

Please mark the most helpful reply/replies as "Answer".

Give some of my PWSK modules a try.
3/1/2009 4:54:31 PM
I still get errors.   Have you ever used GROUP BY with an Indexing Service query?  I am thinking it just won't work 

Server Error in '/SearchIndex' Application.

Incorrect syntax near '('.  Expected ',', '.', FROM. SQLSTATE=42000

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Incorrect syntax near '('.  Expected ',', '.', FROM. SQLSTATE=42000

3/1/2009 4:59:05 PM

Similar Artilces:

Need help running query on Indexing Server in VB.NET with VS2005
In a web project I am trying to run a simple query on a catalog off of our Microsoft Indexing server.  I'm having a couple of problems.  #1 - The tutorials keep refering to a view inside the catalog, but my server admin doesn't know what that means.  How do we find the view name? #2 - The line: Return oCommand.ExecuteReader() returns this error;Incorrect syntax near '-1.'.  Expected end-of-file, ';', AS, CREATE, DOT, DOTDOT, DOTDOT_SCOPE, DOTDOTDOT, DOTDOTDOT_SCOPE, DROP, ORDER_BY, SELECT, SET, WHERE. SQLSTATE=42000The query being executed is:  SELECT ...

Can't Connect .Net application from Windows Server 2003 to Database Server (SQL Server 2000)
Hi, I am having a problem connecting my .net applications from the application server to the database server. When I run the application from my windows xp (sp2) box it works fine. When I try to connect via SQL Management Studio to the database server from the application server I get the same error. Here is the error: System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider...

PLEASE HELP! w/Index Server, Indexing service query
Hello, I have set up indexing service via Index Server on my local machine. I have successfully created the catalog, set up the document directory and indexed the documents within my directory. I am having problems with the query not returning the document properties that I would like to see (such as DocTitle, DocAuthor, etc.) Everything works fine, except for the fact that the result set is not returning the data fields that I need. The search works great (as far as I can tell). I also installed the adobe ifilter so that index server can also search pdf files and that seems to w...

How make a query in terms of File Index value in Index Server ?
I'm writing a Search Query in Index Server SQL language. but not able to get the index value of any document in the Index Server. As this code            strQuery = "Select Filename,PATH from Scope() where FREETEXT('" +strsearchstrings+ "')";             string connstring = "Provider=MSIDXS.1;Integrated Security .='';Data Source="+strCatalog; as shown in the example above i want make a query in in terms of Index of the doc file stored in the Index Server.Is it possible? I tried but its not working out I dont know where the probl...

query a database on the same server
I have two databases (A, B) running under the same ASE server (S). The A and B databases have the same strucute and table names. I want to query a table in A from B, however I can't seem to get the syntax right. I thought it was as follows: SELECT * FROM [db].[user].[table] SELECT * FROM A.DBA.myTable (query run from B) However, this just seems to query the table of the same name in B, whereas I want it to access the other database (A). - Kevin "Kevin Howe" <> wrote in message news:OtS47JU#CHA.317@forums-1-dub... > I have two databas...

Why I cannot create/edit tables in VS.Net Server explorer for SQL Server 2000 Developer local database?
I found that when I install MSDE, then I can create/edit database objects for MSDE database in Visual Studio 2003 Server Explorer, but when I try to create/edit database objects under the default database created by the SQL Server 2000 installation, I cannot do these tasks as no option for these tasks appear when I right-click on the database object in Server Explorer.  Anyone knows why this is happening?sun21170 I reproed your issue. And I found in MSDN it is said the Server Explorer can: -Open and view Server Explorer -Add a data connection -Add a server -Drag a...

Unable to connect to database server: Database server not running
I get this error on one of my clients, although the DB server is, in fact, running. If I go to ODBC, and "TEST CONNECTION" it says OK, and all begins to work within a minute or so again. Sybase][ODBC Driver][Adaptive Server Anywhere]Unable to connect to database server: Database server not running Are there client settings, or server settings, which can eliminate this annoying problem? Our entire website stops working as it's completely db driven, until the error clears itself up... RUNNING ASA 6.0.3030 RT Can you post the parameters you filled in...

index server not indexing
Ok, so I want to add a catalog to the index server. I can add the new catalog, I then add a directory to this catalog. I restart the index server, and merge the index. If I click the index server, in mmc, it shows 0 documents for everything. Everything meaning documents to index, total docs, docs defered for indexing and so on.  I've tried this on vista as well as on win2003 and the same result is obtained, no documents are indexed. In win2003 I can index document, but ONLY the ones in the default catalog, if I paste some documents there they get indexed. So, what have I don...

The SQL Server Service Broker for the current database is not enabled, and as a result query notifications are not supported. Please enable the Service Broker for this database if you wish to use not
Hello,          I receive this error  "The SQL Server Service Broker for the current database is not enabled, and as a result query notifications are not supported.  Please enable the Service Broker for this database if you wish to use notifications." I attach the database in Management Studio to query and enable the broker using the scrip below but to no avail. ALTER DATABASE DataName SET ENABLE_BROKER ‘''<<------successfulandSELECT is_broker_enabled FROM sys.databases WHERE name = 'Database name' ‘'&...

Index Server Advance Query
Where in and index server can I have results of searchs of 2 words.. like "air combat" and not get back "repair" results.. I know if you go to the Index Query form and opt for Advance search I get my single result... but how do you turn that on in or is that a flag I need to turn on in code? thanks mike  Hello,I can't understand what you describe clearly .So Can you describe it in detail? Thanks! ...

Problem with Index Server Query
Hi All, I have a problem regarding Index Server. I want to search a Web site with Meta Tag information. The following query searches the entire document and displays the result : [b]"select doctitle, filename, vpath, rank, characterization from scope() where FREETEXT(Contents, '"+txtSearch.Text +"') and filename <> 'search.aspx' order by rank desc "[/b], where txtSearch is a Server Control Text Box. But I want the search to be specific to Meta Tags only. Can anybody help me out. Thanks & Regards, Murthy. I'm not terribly familiar with Ind...

moving an sql server 2005 database to a sql server 2000 database
I am trying to move a database which I wrote in SQL Server 2005 to a SQL Server 2000 database. I'm not sure the best way to do this....... Can anyone enlighten me?.....   this article explains it.,289625,sid87_gci1149585_tax301536,00.html hth,mcm pizzamaker74: I am trying to move a database which I wrote in SQL Server 2005 to a SQL Server 2000 database. I'm not sure the best way to do this....... Can anyone enlighten me?..... If both are in the same network or box just register the 2005 with the 2000 cr...

Regular Expression for Index Server Query
I'm trying to construct a query to search for image filenames using index server regular expressions. I want to find image files with the words logo or icon. The following query returns files that begin with the word logo in the filename:  #filename logo*.|(jpg|,gif|,png|)  How can I construct a similar query to have multiple words match any part of the image's filename? Something like #filename (*logo*|*icon*).|(jpg|,gif|,png|) doesn't work. Many thanks.  ...

Migrating sql server 2005 express database to sql server 2005 database
Hi, I have an application developed using VWD and sqlserver express database. The express database is turning out to be small in size and we need to migrate to larger sqlserver 2005 database. What are the steps for this migration, please list in detail. Regards, Sandyhttp://www.thequinn.infohttp://www.sksdataservices.com Hi Sandy, To move a database from SQL Express to SQL 2005, you can use the following steps. 1. If your database file is attached to the server instance, you will need to detach it first using SQL management studio. If it is under App_Data folde...

Web resources about - indexing server query -

Indexing Service - Wikipedia, the free encyclopedia
... project, with the component serving as the Content Indexer for the Object File System . Cairo was eventually shelved, but the content indexing ...

Under the Hood: Indexing and Ranking in Graph Search - Facebook
Facebook Engineering hat eine Notiz mit dem Titel Under the Hood: Indexing and Ranking in Graph Search geschrieben. Du kannst den vollständigen ...

English Google App-Indexing office-hours hangout - YouTube
Join us for a *Google office hours hangout about App Indexing* App Indexing connects your website with your smartphone app, so that the app can ...

Google’s app indexing links coming to Safari on iOS by end of month
Google first introduced app indexing for iOS apps in search back in May, allowing in-app content to appear in search results with links that ...

Trends in Wine: Out-Innovated By Beer, Under-Indexing With Hispanics
Is wine losing its buzz? Lately the category has been out-innovated by brewers, who have flooded the market with new beer flavors, brands and ...

Google Extends App Indexing to iOS
... in Chrome , \"in the coming weeks.\" Wald also offered instructions for developers interested in getting their apps indexed: While app indexing ...

Google’s App Indexing speeds up switching to apps from Chrome and Google Search
... update in the Google Developers Blog, I yawned. When I read deeper, though, and saw what it can do, I got a bit more excited. Googles App Indexing ...

Coffee With a Googler: Learn about App Indexing and Search
Posted by Laurence Moroney , Developer Advocate. App Indexing helps you get your mobile app found in Google Search. Once your app is indexed, ...

Re-indexing Magento through the command line
... for a whole host of reasons, for example, if the indexer is timing out or not finishing through the web interface. Magento includes an indexing ...

Resources last updated: 1/5/2016 1:48:04 PM