The present invention provides an indolecarboxylic acid derivative having DP receptor antagonistic activity and a pharmaceutical composition comprising the said compound as an active ingredient, and further a therapeutic agent for treating allergic diseases. A compound of the general formula (I): wherein the ring A is an aromatic carbocyclic ring etc.; the ring B is a nitrogen-containing non-aromatic heterocyclic ring etc.; the formula of -X 1 =X 2 -X 3 =X 4 - is a formula of -C(R 1 )=C(R 2 )-C(R 3 )=C(R 4 )- etc.; X 5 is C(R 5 ) or N; R 1 , R 2 , R 3 , R 4 and R 5 is independently a hydrogen atom, a halogen atom etc; R 6 is a formula of -Z-R 10 etc. wherein Z is alkylene etc., and R 10 is carboxy etc.; R 7 is optionally substituted alkyloxy etc.; R 8 is independently a halogen atom etc.; R 9 is independently optionally substituted alkyl etc.; Y is a single bond etc.; n is 0 etc.; q is 0 etc.; a pharmaceutically acceptable salt or a solvate thereof.